force the user to set number of workers

This commit is contained in:
CodingCat
2016-03-12 13:33:57 -05:00
parent 980898f3fb
commit 16b9e92328
6 changed files with 20 additions and 26 deletions

View File

@@ -33,8 +33,9 @@ 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)
val model = XGBoost.train(trainData, paramMap, round, 5)
val predTest = model.predict(testData.map{x => x.vector})
model.saveModelAsHadoopFile("file:///path/to/xgboost.model")
}