[FLINK] remove nWorker from API

This commit is contained in:
tqchen
2016-03-14 16:18:04 -07:00
parent 084ed6224d
commit 90f7220736
4 changed files with 6 additions and 8 deletions

View File

@@ -72,7 +72,7 @@ object DistTrainWithSpark {
"eta" -> 0.1f,
"max_depth" -> 2,
"objective" -> "binary:logistic").toMap
// use 5 distributed workers to train the model
// use 5 distributed workers to train the model
val model = XGBoost.train(trainRDD, paramMap, numRound, nWorkers = 5)
// save model to HDFS path
model.saveModelToHadoop(outputModelPath)
@@ -100,9 +100,8 @@ object DistTrainWithFlink {
"objective" -> "binary:logistic").toMap
// number of iterations
val round = 2
val nWorkers = 5
// train the model
val model = XGBoost.train(trainData, paramMap, round, nWorkers)
val model = XGBoost.train(trainData, paramMap, round)
val predTrain = model.predict(trainData.map{x => x.vector})
model.saveModelToHadoop("file:///path/to/xgboost.model")
}