我想要做的是基于三类分类模型的预测来产生0-100的分数。
例如。 3类逻辑回归模型的predict_proba给出了3个概率x,y,z,如下所示-
0 1 2
设
现在,我想根据这些概率生成0-100的分数,其中0接近0类,而100接近2类。
最佳答案
尝试这个:
prob['P']=(prob['1']*1+prob['2']*2)/2
prob ['0']乘以0,因此不需要它。
例子:
prob ['0'] = 0.5,prob ['1'] = 0.5,prob ['2'] = 0 ==> prob ['P'] = 0.25
prob ['0'] = 0.75,prob ['1'] = 0.25,prob ['2'] = 0 ==> prob ['P'] = 0.125
prob ['0'] = 0.1,prob ['1'] = 0.2,prob ['2'] = 0.7 ==> prob ['P'] = 0.8
prob ['0'] = 0,prob ['1'] = 0,prob ['2'] = 1 ==> prob ['P'] = 1
关于machine-learning - 将多类模型的类概率转换为分数0-100,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/57577489/