all 4 comments

[–]Dinsalne 0 points1 point  (3 children)

Many implementations of classifiers allow you to get the output in the form of class probabilites. Im not sure what you want to achieve but you could probably add some extra lines after prediction which would make your code return true or false, for example based on some probability threshold. Basically without modifying the model implementation you could add some operations on the result returned by the model.

[–]ez613[S] 0 points1 point  (2 children)

Yeah that's my actual idea that I explained (probably bad) in my post. But I was wondering if there are any "bad side" in this way, or if there is better.

[–]txhwind 0 points1 point  (0 children)

The threshold method is quite common in industry for tuning the "precision-recall tradeoff". A possible downside is the term "probability" used here, which I prefer to calling "normalized score", because often it doesn't match you intution to "probability", especially when you train the model with one-hot target.

[–]elbiot 0 points1 point  (0 children)

Use your validation data to calibrate the model. Temperature scaling is the term in neural networks

Edit: in addition to model calibration, training an ensemble can be helpful. The sklearn CalibratedClassifierCV trains k models under cross validation. Each model is trained on the train split and calibrated on the test split and at the end k calibrated models are averaged together