Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I have a classification task where I have a number of predictors (one of which is the most informative), and I am using the MARS model to construct my classifier (I am interested in any simple model, and using glms for illustrative purposes would be fine too). Now I have a huge class imbalance in the training data (about 2700 negative samples for each positive sample). Similar to Information Retrieval tasks, I am more concerned about predicting the top ranking positive test samples. For this reason, the performance on Precision Recall curves is important to me.

First of all, I simply trained the model on my training data keeping the class imbalance as it is. I visualize my trained model in red, and the most important input in blue.

Training on unbalanced data, evaluation on unbalanced data:

PR for unbalanced training ROC for unbalanced training

Thinking that the class imbalance is throwing the model off, since learning the top ranking positive samples is a miniscule part of the whole data set, I upsampled the positive training points to get a balanced training data set. When I plot the performance on the balanced training set, I get good performance. In both the PR and ROC curves, my trained model does better then the inputs.

Training on (upsampled) balanced data, evaluation also on (upsampled) balanced data:

PR for balanced training, visualised on balanced dataset ROC for balanced training, visualised on balanced dataset

However, if I use this model trained on the balanced data, to predict on the original, unbalanced training set, I still get bad performance on the PR curve.

Training on (upsampled) balanced data, evaluation on original unbalanced data:

PR for balanced training, visualised on original, unbalanced dataset ROC for balanced training, visualised on original, unbalanced dataset

So my questions are:

  1. Is the reason the visualization of the PR curve shows inferior performance of my trained model (red), while ROC curve shows improvements because of the class imbalance?
  2. Can resampling/up-sampling/down-sampling approaches resolve this to force the training to focus on the high precision/low recall region?
  3. Is there any other way to focus training on the high precision/low recall region?
share|improve this question
Could you edit your question to clarify which measures are computed on the training set and which on held out data? – Jack Tanner Jan 24 '12 at 15:19
@JackTanner, everything is computed on the training set for now. Since the model does not have that many parameters, and the number of samples in the training set is huge I don't worry too much about overfitting. Besides, I want to be sure I am getting good performance on the training set before I can expect in in the test set. – highBandWidth Jan 24 '12 at 17:37
What knob are you controlling in your learning algorithm to evaluate precision at different recall levels? Have you tried to expand your feature set, e.g., with feature combinations and transformations? – Jack Tanner Jan 25 '12 at 6:16
@JackTanner, The model that I have (MARS with logit function) gives outputs in the range of 0 to 1, similar to logistic regression. It's basically the same, but includes a few more features. To get precision at different recalls, I simply set the thresholds at different points. I just use the standard way to calculate PR or ROC from a ranked list. – highBandWidth Jan 25 '12 at 20:48

1 Answer

  1. The ROC curve is insensitive to changes in class imbalance; see Fawcett (2004) "ROC Graphs: Notes and Practical Considerations for Researchers".
  2. Up-sampling the low-frequency class is a reasonable approach.
  3. There are many other ways of dealing with class imbalance. Boosting and bagging are two techniques that come to mind. This seems like a relevant recent study: Comparing Boosting and Bagging Techniques With Noisy and Imbalanced Data

P.S. Neat problem; I'd love to know how it turns out.

share|improve this answer
Thanks!! Re point 2, up sampling did not help me train flour the high precision region, since performance in the un balanced data stol suffers in the pr curve. – highBandWidth Jan 24 '12 at 5:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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