简体   繁体   English

回归与分类器predict_proba

[英]Regression vs Classifier predict_proba

Just a quick question, if I want to classify objects into either 0 or 1 but I would like the model to return me a 'likeliness' probability for example if an object is 0.7, it means it has 0.7 chance of being in class 1, do I do a regression or stick to classifiers and use the predict_proba function? 只是一个简单的问题,如果我想将对象分类为0或1,但是我希望模型返回一个“似然”概率,例如,如果一个对象为0.7,则意味着它有0.7的机会被归类为1,进行回归还是坚持使用分类器,并使用predict_proba函数?

How is regression and predict_proba function different? 回归和predict_proba函数有何不同?

Any help is greatly appreciated! 任何帮助是极大的赞赏!

Thank you! 谢谢!

Generally, for a qualitative problem that is to classify between categories or class, we prefer classification. 通常, 对于要在类别或类别之间进行分类的定性问题 ,我们倾向于分类。

for example: to identify if it is night or day. 例如:识别是夜晚还是白天。

For Quantitative problems , we prefer regression to solve the problems. 对于定量问题 ,我们更喜欢使用回归来解决问题。

for example: to identify if its 0th class or 1st class. 例如:识别其第0类还是第1类。

But in a special case, when we have only two classes. 但是在特殊情况下,当我们只有两个类时。 Then, we can use both classification and regression to solve two-class problems as in your case. 然后,我们可以同时使用分类和回归来解决您遇到的两类问题。

Please note that, this explanation is on the behalf of two-class point of view or multi-class problems. 请注意,此解释代表两类观点或多类问题。 Though regression is to deal with real quantitative problems rather than classes. 虽然回归是为了处理实际的定量问题,而不是类别。

Probability has nothing to deal specifically with methods. 概率与方法无关。 Each method deduce a probability and on the basis of that, they predict the outcome. 每种方法都可以推论出概率,并在此基础上预测结果。

It is better if you explain the reference to predict_proba from your question. 最好是从您的问题中解释对predict_proba的引用。

Hope it helps! 希望能帮助到你!

Since you mention the predict_proba function I'm assuming you are referring to the scikit-learn API. 由于您提到了predict_proba函数,所以我假设您是指scikit-learn API。

To obtain class-membership probailities this is the right function. 要获得班级成员资格,这是正确的功能。 In the case of logistic regression, this function is somehow the natural output. 在逻辑回归的情况下,此函数某种程度上是自然输出。

You should also check probability calibration 您还应该检查概率校准

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM