Santhosh Boddana
Santhosh Boddana

Reputation: 11

WARNING: C:/Users/Administrator/workspace/xgboost-win64_release_1.3.0/src/learner.cc:541: Parameters: { xgb_model } might not be used

I want to do Incremental Learning using XGBClassifier. I found xgb_model parameter of XGB can achieve this.

As a 1st Step, I trained XGB Classifier on 1st Data Set. It trained well & Predictions were also made. code is as follows:

from xgboost import XGBClassifier
xgb_model1 = XGBClassifier(objective = 'binary:logistic')
xgb_model1.fit(X_train1, y_train1) # 1st dataset training
# Saving Model_1
xgb_model1.save_model('model_1.model')

As a next step, On trying xgb_model parameter for XGB , some of the trials shows warning for below code snippet.

xgb_model2 = XGBClassifier(objective = 'binary:logistic', xgb_model = 'model_1.model') # Loaded Model_1 using xgb_model parameter
xgb_model2.fit(X_train2, y_train2) # 2nd dataset training

WARNING: C:/Users/Administrator/workspace/xgboost-win64_release_1.3.0/src/learner.cc:541: Parameters: { xgb_model } might not be used.

This may not be accurate due to some parameters are only used in language bindings but passed down to XGBoost core. Or some parameters are not used but slip through this verification. Please open an issue if you find above cases.

[Warning for above code snippet - 2nd time training for Incremental learning]

Upvotes: 1

Views: 2941

Answers (1)

skon7
skon7

Reputation: 379

instead of using the xgb_model in the second step you should use model_in in your parameters the code should be like this:

xgb_model2 = XGBClassifier(objective = 'binary:logistic', model_in = 'model_1.model') # Loaded Model_1 using xgb_model parameter
xgb_model2.fit(X_train2, y_train2) # 2nd dataset training

Upvotes: 1

Related Questions