ShichenXie / scorecardpy

Scorecard Development in python, 评分卡
http://shichen.name/scorecard
MIT License
725 stars 301 forks source link

AUC calculation #53

Closed loveis98 closed 4 years ago

loveis98 commented 4 years ago

Hello Why you treats scores like this (in perf_eva() function)?

if np.mean(pred) < 0 or np.mean(pred) > 1:
        warnings.warn('Since the average of pred is not in [0,1], it is treated as predicted score but not probability.')
        pred = -pred

I mean string pred = -pred exactly

In case of positive scores your computing works incorrectly

ShichenXie commented 4 years ago

You can try to use the score as pred parameter to calculate the AUC value. It will return the right value.