lightgbm训练模型代码

更新时间:2023-05-15 07:42:38 阅读: 评论:0

lightgbm训练模型代码
核心概念界定import lightgbm as lgb
import pandas as pd
def lgb_train(x_train, y_train, x_test, y_test):
clf = lgb.LGBMClassifier(
boosting_type='gbdt',
# num_leaves=31,
num_leaves=31,
reg_alpha=0.05,罗德曼
reg_lambda=1.5,
max_depth=-1,
n_estimators=1200,
objective='binary',
subsample=0.85,
物流成本管理
colsample_bytree=0.8,
subsample_freq=1,蒜黄怎么做好吃
恋爱秘籍
learning_rate=0.035,
#        min_child_weight=0.1,
min_child_samples=25,
ed=2021,
nthread=-1)我想吃屎
clf.fit(X, y, eval_metric='auc', verbo=True, eval_t=[(x_train,y_train),(x_test,y_test)], early_stopping_rounds=5,categorical_feature='auto')
y_pred = clf.predict_proba(x_test)[:, 1]
auc = roc_auc_score(y_test, y_pred)
print(f"lgb-auc:  {auc}")氨甲环酸说明书
importance = pd.Series(data=clf.feature_importances_, index=feature_col, name=("colname", "importance")).sort_values(
ascending=Fal).to_frame()
<_csv('import.csv')黄山的景色
return clf

本文发布于:2023-05-15 07:42:38,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/638132.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:训练   界定   管理   蒜黄   秘籍
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图