【问题标题】:How to figure out the intercept of a xgboost model with gblinear如何用 gblinear 计算 xgboost 模型的截距
【发布时间】:2020-11-18 17:10:23
【问题描述】:

我使用 R 中的 xgboost 库来构建模型; gblinear 被用作助推器。

可以使用 xgb.importance() 拉取每个变量的系数(权重);但是,我找不到最终线性方程的截距。谁能告诉我它在哪里,好吗?

谢谢。

【问题讨论】:

    标签: r linear-regression xgboost intercept


    【解决方案1】:

    正如你提到的,只有模型使用gblinear

    试试这个:

    model.fit(X_train,y_train)
    
    print(model.coef_)
    print(model.intercept_)
    

    【讨论】:

      猜你喜欢
      • 2015-11-13
      • 2023-01-13
      • 2016-02-12
      • 2021-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多