I'm working on a classification problem with unbalanced classes (5% 1's). I want to predict the class, not the probability.
In a binary classification problem, is scikit's classifier.predict()
using 0.5
by default?
If it doesn't, what's the default method? If it does, how do I change it?
In scikit some classifiers have the class_weight='auto'
option, but not all do. With class_weight='auto'
, would .predict()
use the actual population proportion as a threshold?
What would be the way to do this in a classifier like MultinomialNB
that doesn't support class_weight
? Other than using predict_proba()
and then calculation the classes myself.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…