Convert Class Probabilities of a multiclass model to scores in range 0-100

筅森魡賤 提交于 2019-12-11 15:54:30

问题


What I want to do is to generate a score of 0-100 based on the predictions of a three class classification model. For eg. The predict_proba of a 3 class logistic regression model gives me 3 probabilities x, y, z as shown below -

0 1 2

x y z

Now, I want to generate a score of 0-100 based on these probabilities, where 0 is closer to class 0 and 100 is closer to class 2.


回答1:


Try this:

prob['P']=(prob['1']*1+prob['2']*2)/2

prob['0'] is multiplied by 0, so you don't need it.

examples:

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



来源:https://stackoverflow.com/questions/57577489/convert-class-probabilities-of-a-multiclass-model-to-scores-in-range-0-100

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!