【问题标题】:Is it possible to train XGBoost4J-Spark with tree_method='exact' ?是否可以使用 tree_method='exact' 训练 XGBoost4J-Spark?
【发布时间】:2018-03-24 07:24:13
【问题描述】:

我打算在 SparkML 管道中使用带有 tree_method='exact' 的经过训练的 xgboost 模型,因此我需要使用 XGBoost4J-Spark;但是文档说“分布式和外部存储器版本仅支持近似算法。” (https://xgboost.readthedocs.io/en/latest//parameter.html)。有没有办法解决这个问题?

或者,我可以使用基于 C 的 xgboost 训练模型,以及如何将训练后的模型转换为 XGBoostEstimator,它是一个 SparkML 估计器,可以无缝集成到 SparkML 管道中。有没有人遇到过这样的转换器?

我不介意在单个节点而不是集群上运行,因为我可以等待。

感谢任何见解。

【问题讨论】:

    标签: apache-spark-mllib xgboost


    【解决方案1】:

    原来是这样的:

    import ml.dmlc.xgboost4j.scala.XGBoost
    val xgb1 = XGBoost.loadModel("xgb1")
    import ml.dmlc.xgboost4j.scala.spark.XGBoostRegressionModel
    val xgbSpark = new XGBoostRegressionModel(xgb1)
    

    其中xgb1 是使用基于 C 的 xgboost 训练的模型。但是有一个问题;他们的预测不符。我已经在 github repo 上报告了这个问题:https://github.com/dmlc/xgboost/issues/3190

    【讨论】:

      猜你喜欢
      • 2016-09-16
      • 2018-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-20
      相关资源
      最近更新 更多