Alternatives to logistic regression when data is unbalanced Using Python's pandas, sklearn, and stats models API, I have trained a logistic regression on a training dataset that tells me whether or not a particular purchase (based on gender, and other features) was fraudulent. I held out a test set, and under a logistic regression all datapoints are predicted to be within %20 percent of unfraudulent (where fraudulent =0, unfradulent =1). In other words, arbitrarily setting a decision boundary to be 50%, all test points are predicted to be unfraudelent. This is because many many more data points are unfraudulent in the training set than fraudulent.
I am new to statistics, and would like to improve my model. What's the next step?
 A: *

*You can re-set the decision boundary by maximizing the F-score, which takes into consideration both precision and sensitivity. https://en.wikipedia.org/wiki/F1_score

*Without too much added information, you can also set the decision boundary as the probability of fraudulent in your training dataset. Any record with predicted probability above average will be identified as 'fraudulent'.

*Another way to decide the cut-off probability is by assigning 'loss' to each case of misclassification. For instance, non-fraudulent misidentified as fraudulent costs 1, while fraudulent misidentified as non-fraudulent costs 10. Then the optimal decision boundary will be the one that minimizes the sum of loss in your training data. It is more subjective this way, but you can customize your model with some personal beliefs.
A: Did you split your datasets respecting the base rates?  If you did not, you could introduce some bias, as logistic regression intercept reflects base rates. If that's the case, it is possible to simply correct the intercept term (the other parameters need not change). There is a paper describing this approach by King and Zeng , I think in 2001. 
