sklearn logistic regression with unbalanced classes

后端 未结 2 1391
醉酒成梦
醉酒成梦 2021-01-31 10:42

I\'m solving a classification problem with sklearn\'s logistic regression in python.

My problem is a general/generic one. I have a dataset with two classes/result (posi

2条回答
  •  不思量自难忘°
    2021-01-31 10:58

    Have you tried to pass to your class_weight="auto" classifier? Not all classifiers in sklearn support this, but some do. Check the docstrings.

    Also you can rebalance your dataset by randomly dropping negative examples and / or over-sampling positive examples (+ potentially adding some slight gaussian feature noise).

提交回复
热议问题