@@ -122,7 +122,7 @@ private[spark] trait SparkParams[T <: Params] extends HasFeaturesCols with HasFe
122122 final val numWorkers = new IntParam (this , " numWorkers" , " Number of workers used to train xgboost" ,
123123 ParamValidators .gtEq(1 ))
124124
125- final def getNumRound : Int = $(numRound )
125+ final def getNumWorkers : Int = $(numWorkers )
126126
127127 final val forceRepartition = new BooleanParam (this , " forceRepartition" , " If the partition " +
128128 " is equal to numWorkers, xgboost won't repartition the dataset. Set forceRepartition to " +
@@ -133,6 +133,8 @@ private[spark] trait SparkParams[T <: Params] extends HasFeaturesCols with HasFe
133133 final val numRound = new IntParam (this , " numRound" , " The number of rounds for boosting" ,
134134 ParamValidators .gtEq(1 ))
135135
136+ final def getNumRound : Int = $(numRound)
137+
136138 final val numEarlyStoppingRounds = new IntParam (this , " numEarlyStoppingRounds" , " Stop training " +
137139 " Number of rounds of decreasing eval metric to tolerate before stopping training" ,
138140 ParamValidators .gtEq(0 ))
@@ -216,14 +218,14 @@ private[spark] trait SparkParams[T <: Params] extends HasFeaturesCols with HasFe
216218 labelCol, baseMarginCol, weightCol, predictionCol, leafPredictionCol, contribPredictionCol,
217219 forceRepartition, featuresCols, customEval, customObj, featureTypes, featureNames)
218220
219- final def getNumWorkers : Int = $(numWorkers)
220-
221221 def setNumWorkers (value : Int ): T = set(numWorkers, value).asInstanceOf [T ]
222222
223223 def setForceRepartition (value : Boolean ): T = set(forceRepartition, value).asInstanceOf [T ]
224224
225225 def setNumRound (value : Int ): T = set(numRound, value).asInstanceOf [T ]
226226
227+ def setNumEarlyStoppingRounds (value : Int ): T = set(numEarlyStoppingRounds, value).asInstanceOf [T ]
228+
227229 def setFeaturesCol (value : Array [String ]): T = set(featuresCols, value).asInstanceOf [T ]
228230
229231 def setBaseMarginCol (value : String ): T = set(baseMarginCol, value).asInstanceOf [T ]
0 commit comments