What do the two numbers for accuracy, precision, F1, etc. mean?

自作多情 提交于 2019-12-08 04:39:15

问题


My Random Forest model code concludes with:

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)

and this code produces the following output:

Model performance:
  accuracy................. [[0.6622929108639558, 0.9078947368421053]]
  precision................ [[0.6622929108639558, 1.0]]
  F1....................... [[0.304835115538703, 0.5853658536585366]]
  auc...................... 0.9103448275862068

Why am I getting two numbers for accuracy, precision and F1, and what do they mean?

Charles

PS: My environment is:

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

回答1:


the two numbers are the threshold and the value for that metric respectively. Once the threshold is determined the accuracy or precision metric can be calculated.

if you use model.confusion_matrix() you can see what threshold was used.

for example in binary classification, the "threshold" is the value (between 0 and 1) that determines what the predicted class label is. If your model predicts a 0.2 for a particular test case, and your threshold is 0.4, the predicted class label will be 0. If your threshold were 0.15, then the predicted class label would be 1.



来源:https://stackoverflow.com/questions/45404116/what-do-the-two-numbers-for-accuracy-precision-f1-etc-mean

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