我的随机森林模型代码以:
结束print('\nModel performance:')
performance = best_nn.model_performance(test_data = test)
accuracy = performance.accuracy()
precision = performance.precision()
F1 = performance.F1()
auc = performance.auc()
print(' accuracy.................', accuracy)
print(' precision................', precision)
print(' F1.......................', F1)
print(' auc......................', auc)
并且此代码生成以下输出:
Model performance:
accuracy................. [[0.6622929108639558, 0.9078947368421053]]
precision................ [[0.6622929108639558, 1.0]]
F1....................... [[0.304835115538703, 0.5853658536585366]]
auc...................... 0.9103448275862068
为什么我得到准确度,精确度和F1的两个数字,它们是什么意思?
查尔斯
PS:我的环境是:
H2O cluster uptime: 6 mins 02 secs
H2O cluster version: 3.10.4.8
H2O cluster version age: 2 months and 9 days
H2O cluster name: H2O_from_python_Charles_wdmhb7
H2O cluster total nodes: 1
H2O cluster free memory: 21.31 Gb
H2O cluster total cores: 8
H2O cluster allowed cores: 4
H2O cluster status: locked, healthy
H2O connection url: http://localhost:54321
H2O connection proxy:
H2O internal security: False
Python version: 3.6.2 final
答案 0 :(得分:1)
这两个数字分别是该指标的阈值和值。确定阈值后,可以计算accuracy
或precision
指标。
如果您使用model.confusion_matrix()
,则可以查看使用的阈值。
例如在二进制分类中,“阈值”是确定预测类标签是什么的值(在0和1之间)。如果您的模型预测特定测试用例的0.2,并且您的阈值为0.4,则预测的类别标签将为0.如果您的阈值为0.15,则预测的类别标签将为1.