[英]f1-score always ~0.75?
I'm working on (what I think is) a straightforward binary classification problem. 我正在研究(我认为是什么)一个简单的二进制分类问题。 I'm getting this curious result from my parameter grid search that no matter what the parameters are the model always returns an f1-score of ~0.75.
我从参数网格搜索中得到了这个奇怪的结果,无论模型是什么参数,其f1-分数始终为〜0.75。 I'm unsure if this: a) reflects something I'm misunderstanding about the f1-score as a metric, b) is due to some problem with the data or model (I'm using XGBoost) that needs to be corrected, or c) just shows that the model parameters are basically irrelevant and an f1-score of ~0.75 is as good as I'll get.
我不确定这是否:a)反映了我对f1-分数误解为度量标准的误解,b)是由于数据或模型(我使用XGBoost)存在问题而需要更正的,或者c)仅表明模型参数基本上无关紧要,并且f1-分数约为0.75,与我所得到的一样好。
Even more confusingly I got this same result for two entirely different sets of predictors for the same problem (eg if I was predicting real estate value, one set was using neighborhood prices, and the other set was using house characteristics -- different sets of predictors for the same problem). 更令人困惑的是,对于同一问题的两组完全不同的预测变量,我得到了相同的结果(例如,如果我正在预测房地产价值,一组正在使用邻域价格,而另一组正在使用房屋特征-不同组的预测变量对于相同的问题)。 For one set the range was about 0.67-0.82 with an approximately normal variance, and for the second set (shown below) every parameter set gave nearly exactly the same f1-score of 0.7477.
对于一组而言,该范围大约为0.67-0.82,且具有大致正常的方差,而对于第二组(如下所示),每个参数组给出的f1-分数几乎完全相同,为0.7477。
To give some more detail, the current dataset has about 30,000 examples, one class is about 60% of the examples (the other is the 40%). 为了提供更多细节,当前数据集包含大约30,000个示例,一个类大约占示例的60%(另一个是40%)。 I haven't delved deeply into this new dataset yet, but with the previous dataset, when I examined one model more closely, I found reasonable precision and recall values, which changed somewhat with different parameter sets, which ruined my concern that the model was just guessing the more prevalent class.
我还没有深入研究这个新的数据集,但是对于以前的数据集,当我更仔细地检查一个模型时,我发现合理的精度和查全率值随不同的参数集而有所变化,这使我担心模型是只是猜测更普遍的一类。
I'm using XGBoost, and using scikit-learn's GridSearchCV
. 我正在使用XGBoost,并使用scikit-learn的
GridSearchCV
。 Skipping imports etc the grid search code is 跳过导入等,网格搜索代码为
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_)
Full output at https://pastebin.com/NSB0yaNi , with a portion (most) shown here: 完整的输出位于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}
Let's assume your classifier predicts everything as majority class, then your : 假设您的分类器将所有内容预测为多数类,那么您的:
precision = tp/(tp+fp) = 60/(60+40) = 0,6
recall = tp/(tp+fn) = 60/(60+0) = 1
and your f1 score: 和您的f1分数:
f1 = 2*precision*recall/(precision+recall)= 2*0,6*1/(0,6+1)
= 1,2/1,6= 0,75
So probalby your classifier is always predicting the majority class. 所以probalby您的分类器总是在预测多数类。
To check your confusion_matrix once, you can use the following: 要一次检查confusion_matrix,可以使用以下命令:
from sklearn.metrics import confusion_matrix
print(confusion_matrix(y_true, y_pred))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.