LGBranker

官方手册:lightgbm.LGBMRanker — LightGBM 4.6.0.99 documentation

可以看出除了 Classifier 和 Regressor,就支持 Ranker,说明 Ranker 还是很重要和常用的。

使用示例

使用: https://www.kaggle.com/code/bturan19/lightgbm-ranker-introduction/notebook

常见问题

"label_gain"如何设置

label_gain 默认是30,不能超过1。原因好像是复杂度非常高。

https://github.com/microsoft/LightGBM/issues/3422#issuecomment-703920798

在参数里设置:

"label_gain": [i for i in range(max(y_train.max(), y_valid.max()) + 1)],

讨论label_gain的设置方法,可以单独设置,而且可以尝试以指数形式增长,如label_gain=[1, 2, 4, 8, 16]

不一定就是按照label_gain=[1, 2, 3, 4, 5]

https://github.com/microsoft/LightGBM/issues/4808

优化建议:

(1)我们通常会关注排名靠前的文档。因此,一种评论解决方案,将最“糟糕”的文档标记为一个标签,例如 0

(2)如果你真的需要对所有 5000 个文档进行排名,也许使用regression或pair-wise 会更好。

https://github.com/microsoft/LightGBM/issues/2892#issuecomment-596525112

参考信息:

日本的一个比赛,基本面分析,第一。

使用 lgbranker,并且直接用 shap 来解释model


explainer = shap.TreeExplainer(estimators[-1].estimator_low_.estimator)
shap_values = explainer.shap_values(X)
shap.summary_plot(shap_values, X, max_display=X.shape[1])

https://github.com/masahiro-mochizuki/signate-fundamentals-challange-1st-place/blob/main/script/train.ipynb

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐