2017-07-30 24 views
1

我隨機森林模型代碼的結尾是:這兩個數字的準確性,精度,F1等是什麼意思?

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

也許它們是列車的準確性並測試數據。精度和f1相同。但我不確定。 –

回答

1

兩個數是閾值和分別對於該指標值。一旦確定了閾值,可以計算出accuracyprecision度量。

如果您使用model.confusion_matrix(),您可以看到使用了什麼閾值。

例如在二進制分類中,「閾值」是確定預測的類標籤是什麼的值(在0和1之間)。如果您的模型預測特定測試用例爲0.2,並且您的閾值爲0.4,則預測的類別標籤將爲0.如果您的閾值爲0.15,則預測的類別標籤爲1.