I am working on a classification problem and I found my data having a lot of outliers which has resulted in reduction in my recognition rate. I have tried rescaling, normalization techniques like min max, box cox and even log transformation. I am considering of eliminating outliers from box plots but I am afraid I might be eliminating useful features/data required to define the model.

Are there any suggestion on how to deal with such cases. Also further analysis of data revealed that my data constitutes of features belong to dfferent process like web application, apps. I segregated the data based on the processes and I do see that large variation of process resulted in different accuracy ranging from 60-95%

Any tips on how to deal with such cases? In the end I want my classifier to classify irrespective of the process type. So with my current issue, does this imply that my features defined are not good enough or is there something else I can do?

  • 1
    $\begingroup$ One way is to use a robust loss function (cf. e.g., On the Design of Loss Functions for Classification). Another is to use a kernel or learn a representation to make the outliers less so. When I'm visualizing I do omit outliers. $\endgroup$ – Emre May 8 '17 at 5:13
  • $\begingroup$ Please clarify the nature of the outliers. What is an outlier in your case? Does an instance have a single feature value that is wildly out of range? Does the instance have all feature values that are wildly out of range? If one feature value is an outlier, does that make it more likely that other features values (for that instance) will also be outliers? Or is it the class labels that are occasionally wildly wrong? What is the underlying process that causes outliers to occur? Measurement error? Heterogeneity that actually exists in real life? Something else? $\endgroup$ – D.W. May 8 '17 at 23:12

If the number of outliers is small and you are concerned that they will destabilize your solution, you could attempt a random forest classifier. The RF fits trees to random selections of data and variables, and collects "votes" from each, thus reducing the impact of outlier valuers.

On the other hand, if the number of outliers is fairly substantital, you might want to create a new class called "outlier". In the training set, apply this label to those values you have deemed to be outliers and then fit the model with the augmented class. Check if the model correctly identifies outliers in the test set.

This is equivalent to removing the outliers, only it creates a repeatable and machine learning way of doing so.

  • $\begingroup$ sorry for not mentioning this in the original post but i had used randomforests and i was still getting this issue of varying classification accuracy based on process type $\endgroup$ – sam pi May 8 '17 at 23:02

I would try classifying using tree based models(Random Forest short explanation) since they are less sensitive to outliers than linear models.
Addressing the different data-sources can be done by a creation of a categorical feature that describes data source.
Use this feature and train a tree, analyze if the the tree use this feature in its first steps(In Sklearn its quiet simple).
If it is high, look at the sub-trees after each split, if the features used in each sub-tree are different than you should consider training a different model per each data-source.

Hope this helps

  • $\begingroup$ i had used rf model before and i was still getting this issue of varying classification accuracy based on process type $\endgroup$ – sam pi May 8 '17 at 23:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.