[0] validation_0-error:0.240223
Will train until validation_0-error hasn't improved in 30 rounds.
[1] validation_0-error:0.240223
[2] validation_0-error:0.240223
[3] validation_0-error:0.240223
[4] validation_0-error:0.240223
[5] validation_0-error:0.22905
[6] validation_0-error:0.22905
[7] validation_0-error:0.22905
[8] validation_0-error:0.234637
[9] validation_0-error:0.234637
[10] validation_0-error:0.223464
[11] validation_0-error:0.223464
[12] validation_0-error:0.223464
[13] validation_0-error:0.223464
[14] validation_0-error:0.22905
[15] validation_0-error:0.223464
[16] validation_0-error:0.22905
[17] validation_0-error:0.223464
[18] validation_0-error:0.22905
[19] validation_0-error:0.22905
[20] validation_0-error:0.223464
[21] validation_0-error:0.22905
[22] validation_0-error:0.22905
[23] validation_0-error:0.22905
[24] validation_0-error:0.22905
[25] validation_0-error:0.22905
[26] validation_0-error:0.217877
[27] validation_0-error:0.217877
[28] validation_0-error:0.217877
[29] validation_0-error:0.21229
[30] validation_0-error:0.201117
[31] validation_0-error:0.21229
[32] validation_0-error:0.206704
[33] validation_0-error:0.206704
[34] validation_0-error:0.201117
[35] validation_0-error:0.195531
[36] validation_0-error:0.189944
[37] validation_0-error:0.189944
[38] validation_0-error:0.195531
[39] validation_0-error:0.195531
[40] validation_0-error:0.184358
[41] validation_0-error:0.189944
[42] validation_0-error:0.184358
[43] validation_0-error:0.189944
[44] validation_0-error:0.184358
[45] validation_0-error:0.184358
[46] validation_0-error:0.184358
[47] validation_0-error:0.189944
[48] validation_0-error:0.189944
[49] validation_0-error:0.184358
[50] validation_0-error:0.189944
[51] validation_0-error:0.189944
[52] validation_0-error:0.189944
[53] validation_0-error:0.189944
[54] validation_0-error:0.184358
[55] validation_0-error:0.184358
[56] validation_0-error:0.184358
[57] validation_0-error:0.178771
[58] validation_0-error:0.173184
[59] validation_0-error:0.184358
[60] validation_0-error:0.167598
[61] validation_0-error:0.173184
[62] validation_0-error:0.173184
[63] validation_0-error:0.173184
[64] validation_0-error:0.173184
[65] validation_0-error:0.173184
[66] validation_0-error:0.173184
[67] validation_0-error:0.173184
[68] validation_0-error:0.173184
[69] validation_0-error:0.173184
[70] validation_0-error:0.173184
[71] validation_0-error:0.173184
[72] validation_0-error:0.173184
[73] validation_0-error:0.173184
[74] validation_0-error:0.173184
[75] validation_0-error:0.173184
[76] validation_0-error:0.173184
[77] validation_0-error:0.173184
[78] validation_0-error:0.173184
[79] validation_0-error:0.173184
[80] validation_0-error:0.167598
[81] validation_0-error:0.167598
[82] validation_0-error:0.167598
[83] validation_0-error:0.167598
[84] validation_0-error:0.167598
[85] validation_0-error:0.167598
[86] validation_0-error:0.167598
[87] validation_0-error:0.167598
[88] validation_0-error:0.167598
[89] validation_0-error:0.167598
[90] validation_0-error:0.167598
Stopping. Best iteration:
[60] validation_0-error:0.167598
0.8324022346368715 0.40938706057120133
53
Accruacy of LR Classifier: 0.8324022346368715
precision recall f1-score support
0.0 0.82 0.94 0.87 110
1.0 0.87 0.67 0.75 69
avg / total 0.84 0.83 0.83 179
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
'''def optimized_XGBoost():'''
X_train, X_test, y_train, y_test = load_data()
model = xgb.XGBClassifier(max_depth=7, n_estimators=300, min_child_weight=5,
colsample_bytree=0.6, subsample=0.9,reg_alpha=0.005)
eval_data = [(X_test, y_test)]
model.fit(X_train, y_train, eval_set=eval_data, early_stopping_rounds=30)
y_pred = model.predict(X_test)
acc, rmse = calc_accuracy(y_pred, y_test)
print("accuracy:{0:.2f}%".format(100*acc))
'''cv_XGBoost():'''
X_train, X_test, y_train, y_test = load_data()
model = xgb.XGBClassifier(max_depth=7, n_estimators=300, min_child_weight=5,
colsample_bytree=0.6, subsample=0.9,reg_alpha=0.005)
grid_params = {
# 'learning_rate': np.linspace(0.01, 1, 100),# 'n_estimators': list(range(100, 1001, 100)),# 'max_depth': list(range(3, 15, 1)),# 'min_child_weight': list(range(1, 6, 2)),# 'subsample':[i/10.0 for i in range(1,10)],# 'colsample_bytree':[i/10.0 for i in range(1,10)],# 'gamma': [i/10.0 for i in range(0, 5)]'reg_alpha':[0.001, 0.005, 0.01, 0.05,0.1,0.2,0.3,0.4,0.5,0.6]
}
gcv = GridSearchCV(estimator=model, param_grid=grid_params)
gcv.fit(X_train, y_train)
print(gcv.best_params_)
print("Accuracy:{0:.4f}%".format(100*gcv.best_score_))
[0] validation_0-error:0.240223
Will train until validation_0-error hasn't improved in 30 rounds.
[1] validation_0-error:0.189944
[2] validation_0-error:0.21229
[3] validation_0-error:0.201117
[4] validation_0-error:0.206704
[5] validation_0-error:0.201117
[6] validation_0-error:0.195531
[7] validation_0-error:0.189944
[8] validation_0-error:0.184358
[9] validation_0-error:0.178771
[10] validation_0-error:0.173184
[11] validation_0-error:0.173184
[12] validation_0-error:0.178771
[13] validation_0-error:0.178771
[14] validation_0-error:0.173184
[15] validation_0-error:0.173184
[16] validation_0-error:0.173184
[17] validation_0-error:0.167598
[18] validation_0-error:0.178771
[19] validation_0-error:0.173184
[20] validation_0-error:0.173184
[21] validation_0-error:0.167598
[22] validation_0-error:0.173184
[23] validation_0-error:0.173184
[24] validation_0-error:0.178771
[25] validation_0-error:0.178771
[26] validation_0-error:0.173184
[27] validation_0-error:0.173184
[28] validation_0-error:0.173184
[29] validation_0-error:0.184358
[30] validation_0-error:0.178771
[31] validation_0-error:0.173184
[32] validation_0-error:0.167598
[33] validation_0-error:0.173184
[34] validation_0-error:0.167598
[35] validation_0-error:0.162011
[36] validation_0-error:0.167598
[37] validation_0-error:0.156425
[38] validation_0-error:0.156425
[39] validation_0-error:0.167598
[40] validation_0-error:0.167598
[41] validation_0-error:0.167598
[42] validation_0-error:0.167598
[43] validation_0-error:0.167598
[44] validation_0-error:0.167598
[45] validation_0-error:0.167598
[46] validation_0-error:0.167598
[47] validation_0-error:0.167598
[48] validation_0-error:0.167598
[49] validation_0-error:0.167598
[50] validation_0-error:0.167598
[51] validation_0-error:0.167598
[52] validation_0-error:0.162011
[53] validation_0-error:0.162011
[54] validation_0-error:0.162011
[55] validation_0-error:0.167598
[56] validation_0-error:0.167598
[57] validation_0-error:0.167598
[58] validation_0-error:0.167598
[59] validation_0-error:0.167598
[60] validation_0-error:0.167598
[61] validation_0-error:0.173184
[62] validation_0-error:0.173184
[63] validation_0-error:0.167598
[64] validation_0-error:0.173184
[65] validation_0-error:0.173184
[66] validation_0-error:0.167598
[67] validation_0-error:0.162011
Stopping. Best iteration:
[37] validation_0-error:0.156425
accuracy:83.80%
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
{'reg_alpha': 0.1}
Accuracy:81.8820%
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff:
C:\anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
if diff: