簡體   English   中英

F1分數總是〜0.75?

[英]f1-score always ~0.75?

我正在研究(我認為是什么)一個簡單的二進制分類問題。 我從參數網格搜索中得到了這個奇怪的結果,無論模型是什么參數,其f1-分數始終為〜0.75。 我不確定這是否:a)反映了我對f1-分數誤解為度量標准的誤解,b)是由於數據或模型(我使用XGBoost)存在問題而需要更正的,或者c)僅表明模型參數基本上無關緊要,並且f1-分數約為0.75,與我所得到的一樣好。

更令人困惑的是,對於同一問題的兩組完全不同的預測變量,我得到了相同的結果(例如,如果我正在預測房地產價值,一組正在使用鄰域價格,而另一組正在使用房屋特征-不同組的預測變量對於相同的問題)。 對於一組而言,該范圍大約為0.67-0.82,且具有大致正常的方差,而對於第二組(如下所示),每個參數組給出的f1-分數幾乎完全相同,為0.7477。

為了提供更多細節,當前數據集包含大約30,000個示例,一個類大約占示例的60%(另一個是40%)。 我還沒有深入研究這個新的數據集,但是對於以前的數據集,當我更仔細地檢查一個模型時,我發現合理的精度和查全率值隨不同的參數集而有所變化,這使我擔心模型是只是猜測更普遍的一類。

我正在使用XGBoost,並使用scikit-learn的GridSearchCV 跳過導入等,網格搜索代碼為

grid_values = {'n_estimators':[50,100,200,500,1000],'max_depth':[1,3,5,8], 'min_child_weight':range(1,6,2)}

clf=XGBClassifier()

grid_clf=GridSearchCV(clf,param_grid=grid_values,scoring='f1',verbose=10)
grid_clf.fit(game_records,hora)

print('Grid best score (f1): ', grid_clf.best_score_)
print('Grid best parameter (max. f1): ', grid_clf.best_params_)

完整的輸出位於https://pastebin.com/NSB0yaNi ,此處顯示了一部分(大部分):

Fitting 3 folds for each of 60 candidates, totalling 180 fits
[CV] max_depth=1, min_child_weight=1, n_estimators=50 ................
[CV]  max_depth=1, min_child_weight=1, n_estimators=50, score=0.7477603583426652, total=  11.1s
[CV] max_depth=1, min_child_weight=1, n_estimators=50 ................
[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:   11.4s remaining:    0.0s
[CV]  max_depth=1, min_child_weight=1, n_estimators=50, score=0.74772504549909, total=  11.3s
[CV] max_depth=1, min_child_weight=1, n_estimators=50 ................
[Parallel(n_jobs=1)]: Done   2 out of   2 | elapsed:   23.1s remaining:    0.0s
[CV]  max_depth=1, min_child_weight=1, n_estimators=50, score=0.7477773888694436, total=  11.2s
[CV] max_depth=1, min_child_weight=1, n_estimators=100 ...............
[Parallel(n_jobs=1)]: Done   3 out of   3 | elapsed:   34.8s remaining:    0.0s
[CV]  max_depth=1, min_child_weight=1, n_estimators=100, score=0.7477603583426652, total=  21.4s
[CV] max_depth=1, min_child_weight=1, n_estimators=100 ...............
[Parallel(n_jobs=1)]: Done   4 out of   4 | elapsed:   56.8s remaining:    0.0s
[CV]  max_depth=1, min_child_weight=1, n_estimators=100, score=0.74772504549909, total=  21.3s
[CV] max_depth=1, min_child_weight=1, n_estimators=100 ...............
[Parallel(n_jobs=1)]: Done   5 out of   5 | elapsed:  1.3min remaining:    0.0s
[CV]  max_depth=1, min_child_weight=1, n_estimators=100, score=0.7477773888694436, total=  21.0s
[CV] max_depth=1, min_child_weight=1, n_estimators=200 ...............
[Parallel(n_jobs=1)]: Done   6 out of   6 | elapsed:  1.7min remaining:    0.0s
[CV]  max_depth=1, min_child_weight=1, n_estimators=200, score=0.7477603583426652, total=  41.3s
[CV] max_depth=1, min_child_weight=1, n_estimators=200 ...............
[Parallel(n_jobs=1)]: Done   7 out of   7 | elapsed:  2.4min remaining:    0.0s
[CV]  max_depth=1, min_child_weight=1, n_estimators=200, score=0.74772504549909, total=  41.1s
[CV] max_depth=1, min_child_weight=1, n_estimators=200 ...............
[Parallel(n_jobs=1)]: Done   8 out of   8 | elapsed:  3.1min remaining:    0.0s
[CV]  max_depth=1, min_child_weight=1, n_estimators=200, score=0.7477773888694436, total=  41.1s
[CV] max_depth=1, min_child_weight=1, n_estimators=500 ...............
[Parallel(n_jobs=1)]: Done   9 out of   9 | elapsed:  3.7min remaining:    0.0s
[CV]  max_depth=1, min_child_weight=1, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=1, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=1, min_child_weight=1, n_estimators=500, score=0.74772504549909, total= 1.8min
[CV] max_depth=1, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=1, min_child_weight=1, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=1, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=1, min_child_weight=1, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=1, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=1, min_child_weight=1, n_estimators=1000, score=0.74772504549909, total= 3.4min

...

[CV] max_depth=3, min_child_weight=1, n_estimators=50 ................
[CV]  max_depth=3, min_child_weight=1, n_estimators=50, score=0.7477773888694436, total=  10.9s
[CV] max_depth=3, min_child_weight=1, n_estimators=100 ...............
[CV]  max_depth=3, min_child_weight=1, n_estimators=100, score=0.7477603583426652, total=  21.2s
[CV] max_depth=3, min_child_weight=1, n_estimators=100 ...............
[CV]  max_depth=3, min_child_weight=1, n_estimators=100, score=0.74772504549909, total=  21.0s
[CV] max_depth=3, min_child_weight=1, n_estimators=100 ...............
[CV]  max_depth=3, min_child_weight=1, n_estimators=100, score=0.7477773888694436, total=  20.9s
[CV] max_depth=3, min_child_weight=1, n_estimators=200 ...............
[CV]  max_depth=3, min_child_weight=1, n_estimators=200, score=0.7477603583426652, total=  41.0s
[CV] max_depth=3, min_child_weight=1, n_estimators=200 ...............
[CV]  max_depth=3, min_child_weight=1, n_estimators=200, score=0.74772504549909, total=  41.2s
[CV] max_depth=3, min_child_weight=1, n_estimators=200 ...............
[CV]  max_depth=3, min_child_weight=1, n_estimators=200, score=0.7477773888694436, total=  41.4s
[CV] max_depth=3, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=3, min_child_weight=1, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=3, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=3, min_child_weight=1, n_estimators=500, score=0.74772504549909, total= 1.7min
[CV] max_depth=3, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=3, min_child_weight=1, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=3, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=3, min_child_weight=1, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=3, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=3, min_child_weight=1, n_estimators=1000, score=0.74772504549909, total= 3.4min
[CV] max_depth=3, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=3, min_child_weight=1, n_estimators=1000, score=0.7477773888694436, total= 3.4min
[CV] max_depth=3, min_child_weight=3, n_estimators=50 ................
[CV]  max_depth=3, min_child_weight=3, n_estimators=50, score=0.7477603583426652, total=  10.9s
[CV] max_depth=3, min_child_weight=3, n_estimators=50 ................
[CV]  max_depth=3, min_child_weight=3, n_estimators=50, score=0.74772504549909, total=  11.0s
[CV] max_depth=3, min_child_weight=3, n_estimators=50 ................
[CV]  max_depth=3, min_child_weight=3, n_estimators=50, score=0.7477773888694436, total=  10.9s
[CV] max_depth=3, min_child_weight=3, n_estimators=100 ...............
[CV]  max_depth=3, min_child_weight=3, n_estimators=100, score=0.7477603583426652, total=  20.9s
[CV] max_depth=3, min_child_weight=3, n_estimators=100 ...............
[CV]  max_depth=3, min_child_weight=3, n_estimators=100, score=0.74772504549909, total=  21.0s
[CV] max_depth=3, min_child_weight=3, n_estimators=100 ...............
[CV]  max_depth=3, min_child_weight=3, n_estimators=100, score=0.7477773888694436, total=  21.0s
[CV] max_depth=3, min_child_weight=3, n_estimators=200 ...............
[CV]  max_depth=3, min_child_weight=3, n_estimators=200, score=0.7477603583426652, total=  41.2s
[CV] max_depth=3, min_child_weight=3, n_estimators=200 ...............
[CV]  max_depth=3, min_child_weight=3, n_estimators=200, score=0.74772504549909, total=  41.2s
[CV] max_depth=3, min_child_weight=3, n_estimators=200 ...............
[CV]  max_depth=3, min_child_weight=3, n_estimators=200, score=0.7477773888694436, total=  41.2s
[CV] max_depth=3, min_child_weight=3, n_estimators=500 ...............
[CV]  max_depth=3, min_child_weight=3, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=3, min_child_weight=3, n_estimators=500 ...............
[CV]  max_depth=3, min_child_weight=3, n_estimators=500, score=0.74772504549909, total= 1.7min
[CV] max_depth=3, min_child_weight=3, n_estimators=500 ...............
[CV]  max_depth=3, min_child_weight=3, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=3, min_child_weight=3, n_estimators=1000 ..............
[CV]  max_depth=3, min_child_weight=3, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=3, min_child_weight=3, n_estimators=1000 ..............
[CV]  max_depth=3, min_child_weight=3, n_estimators=1000, score=0.74772504549909, total= 3.4min
[CV] max_depth=3, min_child_weight=3, n_estimators=1000 ..............
[CV]  max_depth=3, min_child_weight=3, n_estimators=1000, score=0.7477773888694436, total= 3.4min
[CV] max_depth=3, min_child_weight=5, n_estimators=50 ................
[CV]  max_depth=3, min_child_weight=5, n_estimators=50, score=0.7477603583426652, total=  11.0s
[CV] max_depth=3, min_child_weight=5, n_estimators=50 ................
[CV]  max_depth=3, min_child_weight=5, n_estimators=50, score=0.74772504549909, total=  10.9s
[CV] max_depth=3, min_child_weight=5, n_estimators=50 ................
[CV]  max_depth=3, min_child_weight=5, n_estimators=50, score=0.7477773888694436, total=  10.9s
[CV] max_depth=3, min_child_weight=5, n_estimators=100 ...............
[CV]  max_depth=3, min_child_weight=5, n_estimators=100, score=0.7477603583426652, total=  21.2s
[CV] max_depth=3, min_child_weight=5, n_estimators=100 ...............
[CV]  max_depth=3, min_child_weight=5, n_estimators=100, score=0.74772504549909, total=  21.0s
[CV] max_depth=3, min_child_weight=5, n_estimators=100 ...............
[CV]  max_depth=3, min_child_weight=5, n_estimators=100, score=0.7477773888694436, total=  21.0s
[CV] max_depth=3, min_child_weight=5, n_estimators=200 ...............
[CV]  max_depth=3, min_child_weight=5, n_estimators=200, score=0.7477603583426652, total=  41.1s
[CV] max_depth=3, min_child_weight=5, n_estimators=200 ...............
[CV]  max_depth=3, min_child_weight=5, n_estimators=200, score=0.74772504549909, total=  41.3s
[CV] max_depth=3, min_child_weight=5, n_estimators=200 ...............
[CV]  max_depth=3, min_child_weight=5, n_estimators=200, score=0.7477773888694436, total=  41.0s
[CV] max_depth=3, min_child_weight=5, n_estimators=500 ...............
[CV]  max_depth=3, min_child_weight=5, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=3, min_child_weight=5, n_estimators=500 ...............
[CV]  max_depth=3, min_child_weight=5, n_estimators=500, score=0.74772504549909, total= 1.7min
[CV] max_depth=3, min_child_weight=5, n_estimators=500 ...............
[CV]  max_depth=3, min_child_weight=5, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=3, min_child_weight=5, n_estimators=1000 ..............
[CV]  max_depth=3, min_child_weight=5, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=3, min_child_weight=5, n_estimators=1000 ..............
[CV]  max_depth=3, min_child_weight=5, n_estimators=1000, score=0.74772504549909, total= 3.4min
[CV] max_depth=3, min_child_weight=5, n_estimators=1000 ..............
[CV]  max_depth=3, min_child_weight=5, n_estimators=1000, score=0.7477773888694436, total= 3.4min
[CV] max_depth=5, min_child_weight=1, n_estimators=50 ................
[CV]  max_depth=5, min_child_weight=1, n_estimators=50, score=0.7477603583426652, total=  10.9s
[CV] max_depth=5, min_child_weight=1, n_estimators=50 ................
[CV]  max_depth=5, min_child_weight=1, n_estimators=50, score=0.74772504549909, total=  10.9s
[CV] max_depth=5, min_child_weight=1, n_estimators=50 ................
[CV]  max_depth=5, min_child_weight=1, n_estimators=50, score=0.7477773888694436, total=  10.9s
[CV] max_depth=5, min_child_weight=1, n_estimators=100 ...............
[CV]  max_depth=5, min_child_weight=1, n_estimators=100, score=0.7477603583426652, total=  21.0s
[CV] max_depth=5, min_child_weight=1, n_estimators=100 ...............
[CV]  max_depth=5, min_child_weight=1, n_estimators=100, score=0.74772504549909, total=  21.1s
[CV] max_depth=5, min_child_weight=1, n_estimators=100 ...............
[CV]  max_depth=5, min_child_weight=1, n_estimators=100, score=0.7477773888694436, total=  21.0s
[CV] max_depth=5, min_child_weight=1, n_estimators=200 ...............
[CV]  max_depth=5, min_child_weight=1, n_estimators=200, score=0.7477603583426652, total=  41.3s
[CV] max_depth=5, min_child_weight=1, n_estimators=200 ...............
[CV]  max_depth=5, min_child_weight=1, n_estimators=200, score=0.74772504549909, total=  41.1s
[CV] max_depth=5, min_child_weight=1, n_estimators=200 ...............
[CV]  max_depth=5, min_child_weight=1, n_estimators=200, score=0.7477773888694436, total=  41.1s
[CV] max_depth=5, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=5, min_child_weight=1, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=5, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=5, min_child_weight=1, n_estimators=500, score=0.74772504549909, total= 1.7min
[CV] max_depth=5, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=5, min_child_weight=1, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=5, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=5, min_child_weight=1, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=5, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=5, min_child_weight=1, n_estimators=1000, score=0.74772504549909, total= 3.4min
[CV] max_depth=5, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=5, min_child_weight=1, n_estimators=1000, score=0.7477773888694436, total= 3.4min
[CV] max_depth=5, min_child_weight=3, n_estimators=50 ................
[CV]  max_depth=5, min_child_weight=3, n_estimators=50, score=0.7477603583426652, total=  10.9s
[CV] max_depth=5, min_child_weight=3, n_estimators=50 ................
[CV]  max_depth=5, min_child_weight=3, n_estimators=50, score=0.74772504549909, total=  10.9s
[CV] max_depth=5, min_child_weight=3, n_estimators=50 ................
[CV]  max_depth=5, min_child_weight=3, n_estimators=50, score=0.7477773888694436, total=  11.0s
[CV] max_depth=5, min_child_weight=3, n_estimators=100 ...............
[CV]  max_depth=5, min_child_weight=3, n_estimators=100, score=0.7477603583426652, total=  21.3s
[CV] max_depth=5, min_child_weight=3, n_estimators=100 ...............
[CV]  max_depth=5, min_child_weight=3, n_estimators=100, score=0.74772504549909, total=  20.9s
[CV] max_depth=5, min_child_weight=3, n_estimators=100 ...............
[CV]  max_depth=5, min_child_weight=3, n_estimators=100, score=0.7477773888694436, total=  20.9s
[CV] max_depth=5, min_child_weight=3, n_estimators=200 ...............
[CV]  max_depth=5, min_child_weight=3, n_estimators=200, score=0.7477603583426652, total=  41.1s
[CV] max_depth=5, min_child_weight=3, n_estimators=200 ...............
[CV]  max_depth=5, min_child_weight=3, n_estimators=200, score=0.74772504549909, total=  41.4s
[CV] max_depth=5, min_child_weight=3, n_estimators=200 ...............
[CV]  max_depth=5, min_child_weight=3, n_estimators=200, score=0.7477773888694436, total=  41.1s
[CV] max_depth=5, min_child_weight=3, n_estimators=500 ...............
[CV]  max_depth=5, min_child_weight=3, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=5, min_child_weight=3, n_estimators=500 ...............
[CV]  max_depth=5, min_child_weight=3, n_estimators=500, score=0.74772504549909, total= 1.7min
[CV] max_depth=5, min_child_weight=3, n_estimators=500 ...............
[CV]  max_depth=5, min_child_weight=3, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=5, min_child_weight=3, n_estimators=1000 ..............
[CV]  max_depth=5, min_child_weight=3, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=5, min_child_weight=3, n_estimators=1000 ..............
[CV]  max_depth=5, min_child_weight=3, n_estimators=1000, score=0.74772504549909, total= 3.4min
[CV] max_depth=5, min_child_weight=3, n_estimators=1000 ..............
[CV]  max_depth=5, min_child_weight=3, n_estimators=1000, score=0.7477773888694436, total= 3.4min
[CV] max_depth=5, min_child_weight=5, n_estimators=50 ................
[CV]  max_depth=5, min_child_weight=5, n_estimators=50, score=0.7477603583426652, total=  11.0s
[CV] max_depth=5, min_child_weight=5, n_estimators=50 ................
[CV]  max_depth=5, min_child_weight=5, n_estimators=50, score=0.74772504549909, total=  11.0s
[CV] max_depth=5, min_child_weight=5, n_estimators=50 ................
[CV]  max_depth=5, min_child_weight=5, n_estimators=50, score=0.7477773888694436, total=  10.9s
[CV] max_depth=5, min_child_weight=5, n_estimators=100 ...............
[CV]  max_depth=5, min_child_weight=5, n_estimators=100, score=0.7477603583426652, total=  21.0s
[CV] max_depth=5, min_child_weight=5, n_estimators=100 ...............
[CV]  max_depth=5, min_child_weight=5, n_estimators=100, score=0.74772504549909, total=  21.0s
[CV] max_depth=5, min_child_weight=5, n_estimators=100 ...............
[CV]  max_depth=5, min_child_weight=5, n_estimators=100, score=0.7477773888694436, total=  21.8s
[CV] max_depth=5, min_child_weight=5, n_estimators=200 ...............
[CV]  max_depth=5, min_child_weight=5, n_estimators=200, score=0.7477603583426652, total=  41.2s
[CV] max_depth=5, min_child_weight=5, n_estimators=200 ...............
[CV]  max_depth=5, min_child_weight=5, n_estimators=200, score=0.74772504549909, total=  41.6s
[CV] max_depth=5, min_child_weight=5, n_estimators=200 ...............
[CV]  max_depth=5, min_child_weight=5, n_estimators=200, score=0.7477773888694436, total=  41.2s
[CV] max_depth=5, min_child_weight=5, n_estimators=500 ...............
[CV]  max_depth=5, min_child_weight=5, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=5, min_child_weight=5, n_estimators=500 ...............
[CV]  max_depth=5, min_child_weight=5, n_estimators=500, score=0.74772504549909, total= 1.7min
[CV] max_depth=5, min_child_weight=5, n_estimators=500 ...............
[CV]  max_depth=5, min_child_weight=5, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=5, min_child_weight=5, n_estimators=1000 ..............
[CV]  max_depth=5, min_child_weight=5, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=5, min_child_weight=5, n_estimators=1000 ..............
[CV]  max_depth=5, min_child_weight=5, n_estimators=1000, score=0.74772504549909, total= 3.4min
[CV] max_depth=5, min_child_weight=5, n_estimators=1000 ..............
[CV]  max_depth=5, min_child_weight=5, n_estimators=1000, score=0.7477773888694436, total= 3.4min
[CV] max_depth=8, min_child_weight=1, n_estimators=50 ................
[CV]  max_depth=8, min_child_weight=1, n_estimators=50, score=0.7477603583426652, total=  10.9s
[CV] max_depth=8, min_child_weight=1, n_estimators=50 ................
[CV]  max_depth=8, min_child_weight=1, n_estimators=50, score=0.74772504549909, total=  10.9s
[CV] max_depth=8, min_child_weight=1, n_estimators=50 ................
[CV]  max_depth=8, min_child_weight=1, n_estimators=50, score=0.7477773888694436, total=  10.9s
[CV] max_depth=8, min_child_weight=1, n_estimators=100 ...............
[CV]  max_depth=8, min_child_weight=1, n_estimators=100, score=0.7477603583426652, total=  21.2s
[CV] max_depth=8, min_child_weight=1, n_estimators=100 ...............
[CV]  max_depth=8, min_child_weight=1, n_estimators=100, score=0.74772504549909, total=  21.0s
[CV] max_depth=8, min_child_weight=1, n_estimators=100 ...............
[CV]  max_depth=8, min_child_weight=1, n_estimators=100, score=0.7477773888694436, total=  20.9s
[CV] max_depth=8, min_child_weight=1, n_estimators=200 ...............
[CV]  max_depth=8, min_child_weight=1, n_estimators=200, score=0.7477603583426652, total=  41.0s
[CV] max_depth=8, min_child_weight=1, n_estimators=200 ...............
[CV]  max_depth=8, min_child_weight=1, n_estimators=200, score=0.74772504549909, total=  41.4s
[CV] max_depth=8, min_child_weight=1, n_estimators=200 ...............
[CV]  max_depth=8, min_child_weight=1, n_estimators=200, score=0.7477773888694436, total=  41.0s
[CV] max_depth=8, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=8, min_child_weight=1, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=8, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=8, min_child_weight=1, n_estimators=500, score=0.74772504549909, total= 1.7min
[CV] max_depth=8, min_child_weight=1, n_estimators=500 ...............
[CV]  max_depth=8, min_child_weight=1, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=8, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=8, min_child_weight=1, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=8, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=8, min_child_weight=1, n_estimators=1000, score=0.74772504549909, total= 3.4min
[CV] max_depth=8, min_child_weight=1, n_estimators=1000 ..............
[CV]  max_depth=8, min_child_weight=1, n_estimators=1000, score=0.7477773888694436, total= 3.4min
[CV] max_depth=8, min_child_weight=3, n_estimators=50 ................
[CV]  max_depth=8, min_child_weight=3, n_estimators=50, score=0.7477603583426652, total=  10.9s
[CV] max_depth=8, min_child_weight=3, n_estimators=50 ................
[CV]  max_depth=8, min_child_weight=3, n_estimators=50, score=0.74772504549909, total=  10.9s
[CV] max_depth=8, min_child_weight=3, n_estimators=50 ................
[CV]  max_depth=8, min_child_weight=3, n_estimators=50, score=0.7477773888694436, total=  10.9s
[CV] max_depth=8, min_child_weight=3, n_estimators=100 ...............
[CV]  max_depth=8, min_child_weight=3, n_estimators=100, score=0.7477603583426652, total=  20.9s
[CV] max_depth=8, min_child_weight=3, n_estimators=100 ...............
[CV]  max_depth=8, min_child_weight=3, n_estimators=100, score=0.74772504549909, total=  21.0s
[CV] max_depth=8, min_child_weight=3, n_estimators=100 ...............
[CV]  max_depth=8, min_child_weight=3, n_estimators=100, score=0.7477773888694436, total=  20.9s
[CV] max_depth=8, min_child_weight=3, n_estimators=200 ...............
[CV]  max_depth=8, min_child_weight=3, n_estimators=200, score=0.7477603583426652, total=  41.3s
[CV] max_depth=8, min_child_weight=3, n_estimators=200 ...............
[CV]  max_depth=8, min_child_weight=3, n_estimators=200, score=0.74772504549909, total=  41.1s
[CV] max_depth=8, min_child_weight=3, n_estimators=200 ...............
[CV]  max_depth=8, min_child_weight=3, n_estimators=200, score=0.7477773888694436, total=  41.2s
[CV] max_depth=8, min_child_weight=3, n_estimators=500 ...............
[CV]  max_depth=8, min_child_weight=3, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=8, min_child_weight=3, n_estimators=500 ...............
[CV]  max_depth=8, min_child_weight=3, n_estimators=500, score=0.74772504549909, total= 1.7min
[CV] max_depth=8, min_child_weight=3, n_estimators=500 ...............
[CV]  max_depth=8, min_child_weight=3, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=8, min_child_weight=3, n_estimators=1000 ..............
[CV]  max_depth=8, min_child_weight=3, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=8, min_child_weight=3, n_estimators=1000 ..............
[CV]  max_depth=8, min_child_weight=3, n_estimators=1000, score=0.74772504549909, total= 3.4min
[CV] max_depth=8, min_child_weight=3, n_estimators=1000 ..............
[CV]  max_depth=8, min_child_weight=3, n_estimators=1000, score=0.7477773888694436, total= 3.4min
[CV] max_depth=8, min_child_weight=5, n_estimators=50 ................
[CV]  max_depth=8, min_child_weight=5, n_estimators=50, score=0.7477603583426652, total=  10.9s
[CV] max_depth=8, min_child_weight=5, n_estimators=50 ................
[CV]  max_depth=8, min_child_weight=5, n_estimators=50, score=0.74772504549909, total=  10.9s
[CV] max_depth=8, min_child_weight=5, n_estimators=50 ................
[CV]  max_depth=8, min_child_weight=5, n_estimators=50, score=0.7477773888694436, total=  10.9s
[CV] max_depth=8, min_child_weight=5, n_estimators=100 ...............
[CV]  max_depth=8, min_child_weight=5, n_estimators=100, score=0.7477603583426652, total=  20.9s
[CV] max_depth=8, min_child_weight=5, n_estimators=100 ...............
[CV]  max_depth=8, min_child_weight=5, n_estimators=100, score=0.74772504549909, total=  21.4s
[CV] max_depth=8, min_child_weight=5, n_estimators=100 ...............
[CV]  max_depth=8, min_child_weight=5, n_estimators=100, score=0.7477773888694436, total=  21.0s
[CV] max_depth=8, min_child_weight=5, n_estimators=200 ...............
[CV]  max_depth=8, min_child_weight=5, n_estimators=200, score=0.7477603583426652, total=  41.2s
[CV] max_depth=8, min_child_weight=5, n_estimators=200 ...............
[CV]  max_depth=8, min_child_weight=5, n_estimators=200, score=0.74772504549909, total=  41.3s
[CV] max_depth=8, min_child_weight=5, n_estimators=200 ...............
[CV]  max_depth=8, min_child_weight=5, n_estimators=200, score=0.7477773888694436, total=  41.0s
[CV] max_depth=8, min_child_weight=5, n_estimators=500 ...............
[CV]  max_depth=8, min_child_weight=5, n_estimators=500, score=0.7477603583426652, total= 1.7min
[CV] max_depth=8, min_child_weight=5, n_estimators=500 ...............
[CV]  max_depth=8, min_child_weight=5, n_estimators=500, score=0.74772504549909, total= 1.7min
[CV] max_depth=8, min_child_weight=5, n_estimators=500 ...............
[CV]  max_depth=8, min_child_weight=5, n_estimators=500, score=0.7477773888694436, total= 1.7min
[CV] max_depth=8, min_child_weight=5, n_estimators=1000 ..............
[CV]  max_depth=8, min_child_weight=5, n_estimators=1000, score=0.7477603583426652, total= 3.4min
[CV] max_depth=8, min_child_weight=5, n_estimators=1000 ..............
[CV]  max_depth=8, min_child_weight=5, n_estimators=1000, score=0.74772504549909, total= 3.4min
[CV] max_depth=8, min_child_weight=5, n_estimators=1000 ..............
[CV]  max_depth=8, min_child_weight=5, n_estimators=1000, score=0.7477773888694436, total= 3.4min
[Parallel(n_jobs=1)]: Done 180 out of 180 | elapsed: 227.8min finished
Grid best score (f1):  0.7477542636024276
Grid best parameter (max. f1):  {'max_depth': 1, 'min_child_weight': 1, 'n_estimators': 50}

假設您的分類器將所有內容預測為多數類,那么您的:

precision = tp/(tp+fp) = 60/(60+40) = 0,6
recall = tp/(tp+fn) = 60/(60+0) = 1

和您的f1分數:

f1 = 2*precision*recall/(precision+recall)= 2*0,6*1/(0,6+1)
   = 1,2/1,6= 0,75

所以probalby您的分類器總是在預測多數類。

要一次檢查confusion_matrix,可以使用以下命令:

from sklearn.metrics import confusion_matrix
print(confusion_matrix(y_true, y_pred))

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM