how can I fix this WARNING in Xgboost?

We Are Going To Discuss About how can I fix this WARNING in Xgboost?. So lets Start this Python Article.

how can I fix this WARNING in Xgboost?

  1. How to solve how can I fix this WARNING in Xgboost?

    If you don't want to change any behavior, just set the eval_metric='mlogloss' as the following.
    xgb_model = xgboost.XGBClassifier(num_class=7, learning_rate=0.1, num_iterations=1000, max_depth=10, feature_fraction=0.7, scale_pos_weight=1.5, boosting='gbdt', metric='multiclass', eval_metric='mlogloss')
    From the warning log, you will know what eval_metric algorithm to set to remove the warning. Mostly either mlogloss or logloss.

  2. how can I fix this WARNING in Xgboost?

    If you don't want to change any behavior, just set the eval_metric='mlogloss' as the following.
    xgb_model = xgboost.XGBClassifier(num_class=7, learning_rate=0.1, num_iterations=1000, max_depth=10, feature_fraction=0.7, scale_pos_weight=1.5, boosting='gbdt', metric='multiclass', eval_metric='mlogloss')
    From the warning log, you will know what eval_metric algorithm to set to remove the warning. Mostly either mlogloss or logloss.

Solution 1

If you don’t want to change any behavior, just set the eval_metric='mlogloss' as the following.

xgb_model = xgboost.XGBClassifier(num_class=7,
                                  learning_rate=0.1,
                                  num_iterations=1000,
                                  max_depth=10,
                                  feature_fraction=0.7, 
                                  scale_pos_weight=1.5,
                                  boosting='gbdt',
                                  metric='multiclass',
                                  eval_metric='mlogloss')

From the warning log, you will know what eval_metric algorithm to set to remove the warning. Mostly either mlogloss or logloss.

Original Author Wei Chen Of This Content

Solution 2

You can try this:

import xgb

xgb.set_config(verbosity=0)

Original Author Ali Karasneh Of This Content

Solution 3

I run through exactly the same problem, the reason is that I used incorrect hyperparameters with the XGBClassifier. In your situation, try to remove these hyperparameters boosting, feature_fraction, metric, num_iterations, scale_pos_weight because they are no longer valid, and you can look at the documentation.

This is your error message:

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.

Original Author Phoenix Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment