【发布时间】:2020-11-30 18:39:01
【问题描述】:
如何在使用 XGBoost Spark 4J 训练随机森林时传递 num_parallel_tree 参数?
参考Random Forests in XGBoost后做了以下操作
val hyperParams = Map(
"booster" -> "gbtree",
"objective" -> "binary:logistic",
"evalMetric" -> "logloss",
"num_parallel_tree" -> 100)
val xGBoostClassifier = new XGBoostClassifier(hyperParams)
.setFeaturesCol(vectorAssembler.getOutputCol)
.setLabelCol(labelColumnName)
.setNumRound(1)
但最终模型只有一棵树。看起来num_parallel_tree 参数根本没有被使用。
即使是打印所有正在使用的超参数的 XGBoost 库的日志,也不会打印 num_parallel_tree。
我们使用 XGBoost 1.0.0 版和 spark 2.4.2。
【问题讨论】:
标签: apache-spark random-forest xgboost