【问题标题】:Is there are some ways to know on which subsample of data the XGBoost tree was fitted?是否有一些方法可以知道 XGBoost 树安装在哪个数据子样本上?
【发布时间】:2020-05-26 21:17:48
【问题描述】:

我正在做一些 XGBoost 练习,我想知道 XGBRegressor 的树适合哪些数据子集。这里是我使用的参数列表:

params = {'learning_rate': 0.09, 
          'n_estimators': 5,
          'objective': 'reg:squarederror',
          'max_depth': 6,
          'subsample': 0.2 
         }

我正在使用 Python 3.7 和 XGBoost 库。那么有什么方法可以知道吗?我已阅读文档,但找不到有用的内容。

【问题讨论】:

    标签: python machine-learning scikit-learn xgboost boosting


    【解决方案1】:

    您可以轻松地绘制树并查看它 你可以用

    export_graphiviz(uralgo,"filename",feature_names,rounded=True)
    

    【讨论】:

    • 它只显示一棵树,但我需要数据集的索引或行来适应该树
    猜你喜欢
    • 2021-02-22
    • 1970-01-01
    • 2021-01-12
    • 2011-05-05
    • 1970-01-01
    • 2020-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多