简体   繁体   English

LGBMregressor 的 BayesSearchCV:如何在训练和 CV 评分中对样本进行加权?

[英]BayesSearchCV of LGBMregressor: how to weight samples in both training and CV scoring?

While optimizing LightGBM hyperparameters, I'd like to individually weight samples during both training and CV scoring.在优化 LightGBM 超参数时,我想在训练和 CV 评分期间分别对样本进行加权。 From the BayesSearchCV docs , it seems that a way to do that could be to insert a LGBMregressor sample_weight key into the BayesSearchCV fit_params option.BayesSearchCV docs看来,一种方法可能是将LGBMregressor sample_weight键插入 BayesSearchCV fit_params选项。 But this is not clear because both BayesSearchCV and LGBMregressor have fit methods.但这并不清楚,因为 BayesSearchCV 和 LGBMregressor 都有fit方法。

To which fit method is the BayesSearchCV fit_params going? BayesSearchCV fit_params哪种fit方法? And is using fit_params really the way to weight samples during both training and CV scoring?在训练和 CV 评分期间,使用fit_params真的是对样本进行加权的方法吗?

Based on the documentation I believe fit_params is passed as an argument upon BayesSearchCV() instantiation, not when the.fit() method is called.根据文档,我相信fit_params在 BayesSearchCV() 实例化时作为参数传递,而不是在调用 .fit() 方法时传递。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError: &#39;LGBMRegressor&#39; 对象没有属性 &#39;feature_name_&#39; - AttributeError: 'LGBMRegressor' object has no attribute 'feature_name_' BayesSearchCV TypeError:“版本”和“元组”的实例之间不支持“&lt;” - BayesSearchCV TypeError: '<' not supported between instances of 'Version' and 'tuple' 带有 LGBMRegressor 的 GridSearchCV 找不到最佳参数 - GridSearchCV with LGBMRegressor can't find best parameters 如何计算lightgbm中的重量和价值? - How to calculate the weight and value in lightgbm? BayesSearchCV - lightgbm - 提前停止 - “ValueError: not enough values to unpack” - BayesSearchCV - lightgbm - early stopping - "ValueError: not enough values to unpack" 将 LGBMRegressor 模型从 python lightgbm 包保存到光盘 - Save LGBMRegressor model from python lightgbm package to disc 如何在lightgbm中为不平衡数据集设置多类(4类)分类的权重? - How to set the weight in muticlass (4 classes) classification in lightgbm for imbalanced dataset? lightgbm手动计分功能:F1_SCORE - lightgbm Manual scoring function : F1_SCORE lightgbm.sklearn.LGBMRegressor 未能拟合简单的线条 - lightgbm.sklearn.LGBMRegressor failed to fit simple line 如何使用light gbm cv产生light gbm train函数 - How to use the light gbm cv results in light gbm train function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM