是否有可能在XGBoost算法中指定叶片节点的最小重量分数?

发布于 2025-02-01 04:00:30 字数 383 浏览 3 评论 0原文

我试图实现一种简单的XGBoost算法,并希望指定我的样品的最小重量分数,应在每个叶子节点中实现。到目前为止,我只找到了参数min_child_weight,该参数指定了节点中的最小样本数。我想知道我是否有一种方法可以在此处结合每个样品的重量,因为不是每个样本的重量= 1?

如果有人可以在这里提供帮助,我会非常高兴!谢谢:)

下面您可以找到我的代码:

xg_r = xg.XGBRegressor(objective="reg:squarederror", n_estimators = 10, max_depth = 5, min_child_weight = 500000)
xg_r.fit(X_train, y_train)
xg.plot_tree(xg_r) 

I tried to implement a simple XGBoost algorithm and would like to specify a minimum weight fraction of my samples, that should be fulfilled in every leaf node. So far I only found the parameter min_child_weight, which specifies the minimum number of samples in a node. I would like to know if there is a way of how I can incorporate the weight of each sample here, since not each sample has weight=1?

I would be super glad if someone can help here! Thank you :)

Below you can find my code:

xg_r = xg.XGBRegressor(objective="reg:squarederror", n_estimators = 10, max_depth = 5, min_child_weight = 500000)
xg_r.fit(X_train, y_train)
xg.plot_tree(xg_r) 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文