Issue
model = lightgbm.LGBMClassifier()
hyperparameter_dictionary = {'boosting_type': 'goss', 'num_leaves': 25, 'n_estimators': 184, ...}
How do I set the model's hyperparameters with the dictionary?
Thanks!
Solution
pass the hyperparam dictionary to the model constructor, adding **
to the dict to pass each dict item like a kwarg param as lgbm expects it per https://lightgbm.readthedocs.io/en/latest/pythonapi/lightgbm.LGBMClassifier.html#lightgbm.LGBMClassifier:
hyperparameter_dictionary = {'boosting_type': 'goss', 'num_leaves': 25, 'n_estimators': 184}
model = lightgbm.LGBMClassifier(**hyperparameter_dictionary)
TEST:
print(model)
LGBMClassifier(boosting_type='goss', ... n_estimators=184, n_jobs=-1, num_leaves=25,...)
Answered By - Max Power
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.