I am working on a binary classification problem where one of the most interesting features has a distribution which looks more or less bimodal. Here is the distribution plot of that feature: enter image description here

The two modes seem to correspond to two classes. When I look at the distribution of this feature corresponding to each class separately, this is what I get: enter image description here

enter image description here

Clearly, one of them is more like a log-normal distribution, and the other is more like normal, and the two peaks in the original distribution seems to correspond to two different classes. My question is how do I deal with this kind of bimodality in Logistic regression. Also, would other machine learning algorithms be more suitable for this kind of a problem?

  • 4
    $\begingroup$ What does it mean to “deal with” the feature? Bimodality of the distribution isn’t an obstacle for logistic regression. $\endgroup$
    – Sycorax
    Commented Dec 17, 2021 at 20:25
  • 3
    $\begingroup$ The features in a logistic regression do not have distribution assumptions (except that constant features are unhelpful), so what problem do you see with your bimodal feature? $\endgroup$
    – Dave
    Commented Dec 17, 2021 at 20:29
  • $\begingroup$ If you know the two classes then you can incorporate them into your logistic regression $\endgroup$
    – Henry
    Commented Dec 17, 2021 at 20:50
  • $\begingroup$ @Henry I take that comment to mean that the two classes are the classes being predicted. $\endgroup$
    – Dave
    Commented Dec 17, 2021 at 20:55
  • 1
    $\begingroup$ @Dave you may be correct. I had guessed these were credit scores, that the two classes were something like "does not have a formal job" and "has a formal job" and the prediction was "will default" or "will not default" $\endgroup$
    – Henry
    Commented Dec 17, 2021 at 20:58

1 Answer 1


Stick that feature in your regression like you would any other feature. Logistic regression makes no assumption that the features have a particular distribution. I suspect this misconception comes from the same confusion that people have about OLS linear regression.

Since the distribution of that feature for each $y$ category is not just a shift in location, you might benefit from using some nonlinear functions of this feature, such as a spline, but the distributions are so different that I expect this feature to give considerable discriminative ability on its own.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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