运行 ❯
获取你自己的
Python
服务器
×
更改方向
更改主题,深色/浅色
转至 Spaces
import numpy from sklearn import metrics actual = numpy.random.binomial(1,.9,size = 1000) predicted = numpy.random.binomial(1,.9,size = 1000) Accuracy = metrics.accuracy_score(actual, predicted) Precision = metrics.precision_score(actual, predicted) Sensitivity_recall = metrics.recall_score(actual, predicted) Specificity = metrics.recall_score(actual, predicted, pos_label=0) F1_score = metrics.f1_score(actual, predicted) #metrics: print({"Accuracy":Accuracy,"Precision":Precision,"Sensitivity_recall":Sensitivity_recall,"Specificity":Specificity,"F1_score":F1_score})