ml.dmlc.xgboost4j.scala.spark

# XGBoostRegressionModel

###
Related Doc: package spark

#### class XGBoostRegressionModel extends XGBoostModel

class of XGBoost model used for regression task

Linear Supertypes
XGBoostModel, MLWritable, BoosterParams, PredictionModel[Vector, XGBoostModel], PredictorParams, HasPredictionCol, HasFeaturesCol, HasLabelCol, Model[XGBoostModel], Transformer, PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. XGBoostRegressionModel
2. XGBoostModel
3. MLWritable
4. BoosterParams
5. PredictionModel
6. PredictorParams
7. HasPredictionCol
8. HasFeaturesCol
9. HasLabelCol
10. Model
11. Transformer
12. PipelineStage
13. Logging
14. Params
15. Serializable
16. Serializable
17. Identifiable
18. AnyRef
19. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1. #### new XGBoostRegressionModel(uid: String)

2. #### new XGBoostRegressionModel(_booster: Booster)

### Value Members

1. #### final def !=(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

2. #### final def ##(): Int

   Definition Classes
     AnyRef → Any

3. #### final def $[T](param: Param[T]): T

   Attributes
     protected
   Definition Classes
     Params

4. #### final def ==(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

5. #### var _booster: Booster

   Attributes
     protected
   Definition Classes
     XGBoostModel

6. #### val alpha: DoubleParam

   L1 regularization term on weights, increase this value will make model more conservative.

   L1 regularization term on weights, increase this value will make model more conservative. [default=0]

   Definition Classes
     BoosterParams

7. #### final def asInstanceOf[T0]: T0

   Definition Classes
     Any

8. #### def booster: Booster

   Definition Classes
     XGBoostModel

9. #### val boosterType: Param[String]

   Booster to use, options: {'gbtree', 'gblinear', 'dart'}

   Booster to use, options: {'gbtree', 'gblinear', 'dart'}

   Definition Classes
     BoosterParams

10. #### final def clear(param: Param[_]): XGBoostRegressionModel.this.type

    Definition Classes
      Params

11. #### def clone(): AnyRef

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

12. #### val colSampleByLevel: DoubleParam

    subsample ratio of columns for each split, in each level.

    subsample ratio of columns for each split, in each level. [default=1] range: (0,1]

    Definition Classes
      BoosterParams

13. #### val colSampleByTree: DoubleParam

    subsample ratio of columns when constructing each tree.

    subsample ratio of columns when constructing each tree. [default=1] range: (0,1]

    Definition Classes
      BoosterParams

14. #### def copy(extra: ParamMap): XGBoostRegressionModel

    Definition Classes
      XGBoostRegressionModel → XGBoostModel → Model → Transformer → PipelineStage → Params

15. #### def copyValues[T <: Params](to: T, extra: ParamMap): T

    Attributes
      protected
    Definition Classes
      Params

16. #### final def defaultCopy[T <: Params](extra: ParamMap): T

    Attributes
      protected
    Definition Classes
      Params

17. #### final def eq(arg0: AnyRef): Boolean

    Definition Classes
      AnyRef

18. #### def equals(arg0: Any): Boolean

    Definition Classes
      AnyRef → Any

19. #### val eta: DoubleParam

    step size shrinkage used in update to prevents overfitting.

    step size shrinkage used in update to prevents overfitting. After each boosting step, we can directly get the weights of new features and eta actually shrinks the feature weights to make the boosting process more conservative. [default=0.3] range: [0,1]

    Definition Classes
      BoosterParams

20. #### def eval(evalDataset: RDD[org.apache.spark.ml.feature.LabeledPoint], evalName: String, evalFunc: EvalTrait = null, iter: Int = 1, useExternalCache: Boolean = false, groupData: Seq[Seq[Int]] = null): String

    evaluate XGBoostModel with a RDD-wrapped dataset

    evaluate XGBoostModel with a RDD-wrapped dataset

    NOTE: you have to specify value of either eval or iter; when you specify both, this method adopts the default eval metric of model

    evalDataset

      the dataset used for evaluation

    evalName

      the name of evaluation

    evalFunc

      the customized evaluation function, null by default to use the default metric of model

    iter

      the current iteration, -1 to be null to use customized evaluation functions

    groupData

      group data specify each group size for ranking task. Top level corresponds to partition id, second level is the group sizes.

    returns

      the average metric over all partitions

    Definition Classes
      XGBoostModel

21. #### def explainParam(param: Param[_]): String

    Definition Classes
      Params

22. #### def explainParams(): String

    Explains all params of this instance.

    Explains all params of this instance. See `explainParam()`.

    Definition Classes
      BoosterParams → Params

23. #### final def extractParamMap(): ParamMap

    Definition Classes
      Params

24. #### final def extractParamMap(extra: ParamMap): ParamMap

    Definition Classes
      Params

25. #### final val featuresCol: Param[String]

    Definition Classes
      HasFeaturesCol

26. #### def featuresDataType: DataType

    Attributes
      protected
    Definition Classes
      PredictionModel

27. #### def finalize(): Unit

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )

28. #### val gamma: DoubleParam

    minimum loss reduction required to make a further partition on a leaf node of the tree.

    minimum loss reduction required to make a further partition on a leaf node of the tree. the larger, the more conservative the algorithm will be. [default=0] range: [0, Double.MaxValue]

    Definition Classes
      BoosterParams

29. #### final def get[T](param: Param[T]): Option[T]

    Definition Classes
      Params

30. #### final def getClass(): Class[_]

    Definition Classes
      AnyRef → Any

31. #### final def getDefault[T](param: Param[T]): Option[T]

    Definition Classes
      Params

32. #### final def getFeaturesCol: String

    Definition Classes
      HasFeaturesCol

33. #### final def getLabelCol: String

    Definition Classes
      HasLabelCol

34. #### final def getOrDefault[T](param: Param[T]): T

    Definition Classes
      Params

35. #### def getParam(paramName: String): Param[Any]

    Definition Classes
      Params

36. #### final def getPredictionCol: String

    Definition Classes
      HasPredictionCol

37. #### val growthPolicty: Param[String]

    growth policy for fast histogram algorithm

    growth policy for fast histogram algorithm

    Definition Classes
      BoosterParams

38. #### final def hasDefault[T](param: Param[T]): Boolean

    Definition Classes
      Params

39. #### def hasParam(paramName: String): Boolean

    Definition Classes
      Params

40. #### def hasParent: Boolean

    Definition Classes
      Model

41. #### def hashCode(): Int

    Definition Classes
      AnyRef → Any

42. #### def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean

    Attributes
      protected
    Definition Classes
      Logging

43. #### def initializeLogIfNecessary(isInterpreter: Boolean): Unit

    Attributes
      protected
    Definition Classes
      Logging

44. #### final def isDefined(param: Param[_]): Boolean

    Definition Classes
      Params

45. #### final def isInstanceOf[T0]: Boolean

    Definition Classes
      Any

46. #### final def isSet(param: Param[_]): Boolean

    Definition Classes
      Params

47. #### def isTraceEnabled(): Boolean

    Attributes
      protected
    Definition Classes
      Logging

48. #### final val labelCol: Param[String]

    Definition Classes
      HasLabelCol

49. #### val lambda: DoubleParam

    L2 regularization term on weights, increase this value will make model more conservative.

    L2 regularization term on weights, increase this value will make model more conservative. [default=1]

    Definition Classes
      BoosterParams

50. #### val lambdaBias: DoubleParam

    Parameter of linear booster L2 regularization term on bias, default 0(no L1 reg on bias because it is not important)

    Parameter of linear booster L2 regularization term on bias, default 0(no L1 reg on bias because it is not important)

    Definition Classes
      BoosterParams

51. #### def log: Logger

    Attributes
      protected
    Definition Classes
      Logging

52. #### def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
      protected
    Definition Classes
      Logging

53. #### def logDebug(msg: ⇒ String): Unit

    Attributes
      protected
    Definition Classes
      Logging

54. #### def logError(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
      protected
    Definition Classes
      Logging

55. #### def logError(msg: ⇒ String): Unit

    Attributes
      protected
    Definition Classes
      Logging

56. #### def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
      protected
    Definition Classes
      Logging

57. #### def logInfo(msg: ⇒ String): Unit

    Attributes
      protected
    Definition Classes
      Logging

58. #### def logName: String

    Attributes
      protected
    Definition Classes
      Logging

59. #### def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
      protected
    Definition Classes
      Logging

60. #### def logTrace(msg: ⇒ String): Unit

    Attributes
      protected
    Definition Classes
      Logging

61. #### def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
      protected
    Definition Classes
      Logging

62. #### def logWarning(msg: ⇒ String): Unit

    Attributes
      protected
    Definition Classes
      Logging

63. #### val maxBins: IntParam

    maximum number of bins in histogram

    maximum number of bins in histogram

    Definition Classes
      BoosterParams

64. #### val maxDeltaStep: DoubleParam

    Maximum delta step we allow each tree's weight estimation to be.

    Maximum delta step we allow each tree's weight estimation to be. If the value is set to 0, it means there is no constraint. If it is set to a positive value, it can help making the update step more conservative. Usually this parameter is not needed, but it might help in logistic regression when class is extremely imbalanced. Set it to value of 1-10 might help control the update. [default=0] range: [0, Double.MaxValue]

    Definition Classes
      BoosterParams

65. #### val maxDepth: IntParam

    maximum depth of a tree, increase this value will make model more complex / likely to be overfitting.

    maximum depth of a tree, increase this value will make model more complex / likely to be overfitting. [default=6] range: [1, Int.MaxValue]

    Definition Classes
      BoosterParams

66. #### val minChildWeight: DoubleParam

    minimum sum of instance weight(hessian) needed in a child.

    minimum sum of instance weight(hessian) needed in a child. If the tree partition step results in a leaf node with the sum of instance weight less than min_child_weight, then the building process will give up further partitioning. In linear regression mode, this simply corresponds to minimum number of instances needed to be in each node. The larger, the more conservative the algorithm will be. [default=1] range: [0, Double.MaxValue]

    Definition Classes
      BoosterParams

67. #### final def ne(arg0: AnyRef): Boolean

    Definition Classes
      AnyRef

68. #### val normalizeType: Param[String]

    Parameter of Dart booster.

    Parameter of Dart booster. type of normalization algorithm, options: {'tree', 'forest'}. [default="tree"]

    Definition Classes
      BoosterParams

69. #### final def notify(): Unit

    Definition Classes
      AnyRef

70. #### final def notifyAll(): Unit

    Definition Classes
      AnyRef

71. #### def numFeatures: Int

    Definition Classes
      PredictionModel
    Annotations
      @Since( "1.6.0" )

72. #### lazy val params: Array[Param[_]]

    Definition Classes
      Params

73. #### var parent: Estimator[XGBoostModel]

    Definition Classes
      Model

74. #### def predict(features: Vector): Double

    Attributes
      protected
    Definition Classes
      XGBoostRegressionModel → PredictionModel

75. #### def predict(testSet: RDD[Vector], useExternalCache: Boolean = false, outputMargin: Boolean = false): RDD[Array[Float]]

    Predict result with the given test set (represented as RDD)

    Predict result with the given test set (represented as RDD)

    testSet

      test set represented as RDD

    useExternalCache

      whether to use external cache for the test set

    outputMargin

      whether to output raw untransformed margin value

    Definition Classes
      XGBoostModel

76. #### def predict(testSet: RDD[DenseVector], missingValue: Float): RDD[Array[Float]]

    Predict result with the given test set (represented as RDD)

    Predict result with the given test set (represented as RDD)

    testSet

      test set represented as RDD

    missingValue

      the specified value to represent the missing value

    Definition Classes
      XGBoostModel

77. #### def predictLeaves(testSet: RDD[Vector]): RDD[Array[Float]]

    Predict leaf instances with the given test set (represented as RDD)

    Predict leaf instances with the given test set (represented as RDD)

    testSet

      test set represented as RDD

    Definition Classes
      XGBoostModel

78. #### final val predictionCol: Param[String]

    Definition Classes
      HasPredictionCol

79. #### def produceRowRDD(testSet: Dataset[_], outputMargin: Boolean = false, predLeaf: Boolean = false): RDD[Row]

    Attributes
      protected
    Definition Classes
      XGBoostModel

80. #### val rateDrop: DoubleParam

    Parameter of Dart booster.

    Parameter of Dart booster. dropout rate. [default=0.0] range: [0.0, 1.0]

    Definition Classes
      BoosterParams

81. #### val sampleType: Param[String]

    Parameter for Dart booster.

    Parameter for Dart booster. Type of sampling algorithm. "uniform": dropped trees are selected uniformly. "weighted": dropped trees are selected in proportion to weight. [default="uniform"]

    Definition Classes
      BoosterParams

82. #### def save(path: String): Unit

    Definition Classes
      MLWritable
    Annotations
      @Since( "1.6.0" ) @throws( ... )

83. #### def saveModelAsHadoopFile(modelPath: String)(implicit sc: SparkContext): Unit

    Save the model as to HDFS-compatible file system.

    Save the model as to HDFS-compatible file system.

    modelPath

      The model path as in Hadoop path.

    Definition Classes
      XGBoostModel

84. #### val scalePosWeight: DoubleParam

    Control the balance of positive and negative weights, useful for unbalanced classes.

    Control the balance of positive and negative weights, useful for unbalanced classes. A typical value to consider: sum(negative cases) / sum(positive cases). [default=1]

    Definition Classes
      BoosterParams

85. #### final def set(paramPair: ParamPair[_]): XGBoostRegressionModel.this.type

    Attributes
      protected
    Definition Classes
      Params

86. #### final def set(param: String, value: Any): XGBoostRegressionModel.this.type

    Attributes
      protected
    Definition Classes
      Params

87. #### final def set[T](param: Param[T], value: T): XGBoostRegressionModel.this.type

    Definition Classes
      Params

88. #### final def setDefault(paramPairs: ParamPair[_]*): XGBoostRegressionModel.this.type

    Attributes
      protected
    Definition Classes
      Params

89. #### final def setDefault[T](param: Param[T], value: T): XGBoostRegressionModel.this.type

    Attributes
      protected
    Definition Classes
      Params

90. #### def setExternalMemory(value: Boolean): XGBoostModel

    Definition Classes
      XGBoostModel

91. #### def setFeaturesCol(value: String): XGBoostModel

    Definition Classes
      PredictionModel

92. #### def setLabelCol(name: String): XGBoostModel

    Definition Classes
      XGBoostModel

93. #### def setParent(parent: Estimator[XGBoostModel]): XGBoostModel

    Definition Classes
      Model

94. #### def setPredictionCol(value: String): XGBoostModel

    Definition Classes
      PredictionModel

95. #### val sketchEps: DoubleParam

    This is only used for approximate greedy algorithm.

    This is only used for approximate greedy algorithm. This roughly translated into O(1 / sketch_eps) number of bins. Compared to directly select number of bins, this comes with theoretical guarantee with sketch accuracy. [default=0.03] range: (0, 1)

    Definition Classes
      BoosterParams

96. #### val skipDrop: DoubleParam

    Parameter of Dart booster.

    Parameter of Dart booster. probability of skip dropout. If a dropout is skipped, new trees are added in the same manner as gbtree. [default=0.0] range: [0.0, 1.0]

    Definition Classes
      BoosterParams

97. #### val subSample: DoubleParam

    subsample ratio of the training instance.

    subsample ratio of the training instance. Setting it to 0.5 means that XGBoost randomly collected half of the data instances to grow trees and this will prevent overfitting. [default=1] range:(0,1]

    Definition Classes
      BoosterParams

98. #### def summary: XGBoostTrainingSummary

    Returns summary (e.g.

    Returns summary (e.g. train/test objective history) of model on the training set. An exception is thrown if no summary is available.

    Definition Classes
      XGBoostModel

99. #### final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
      AnyRef

100. #### def toString(): String

     Definition Classes
       Identifiable → AnyRef → Any

101. #### def transform(testSet: Dataset[_]): DataFrame

     produces the prediction results and append as an additional column in the original dataset NOTE: the prediction results is kept as the original format of xgboost

     produces the prediction results and append as an additional column in the original dataset NOTE: the prediction results is kept as the original format of xgboost

     returns

       the original dataframe with an additional column containing prediction results

     Definition Classes
       XGBoostModel → PredictionModel → Transformer

102. #### def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame

     Definition Classes
       Transformer
     Annotations
       @Since( "2.0.0" )

103. #### def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame

     Definition Classes
       Transformer
     Annotations
       @Since( "2.0.0" ) @varargs()

104. #### def transformImpl(testSet: Dataset[_]): DataFrame

     Attributes
       protected
     Definition Classes
       XGBoostRegressionModel → XGBoostModel → PredictionModel

105. #### def transformLeaf(testSet: Dataset[_]): DataFrame

     append leaf index of each row as an additional column in the original dataset

     append leaf index of each row as an additional column in the original dataset

     returns

       the original dataframe with an additional column containing prediction results

     Definition Classes
       XGBoostModel

106. #### def transformSchema(schema: StructType): StructType

     Definition Classes
       PredictionModel → PipelineStage

107. #### def transformSchema(schema: StructType, logging: Boolean): StructType

     Attributes
       protected
     Definition Classes
       PipelineStage
     Annotations
       @DeveloperApi()

108. #### val treeMethod: Param[String]

     The tree construction algorithm used in XGBoost.

     The tree construction algorithm used in XGBoost. options: {'auto', 'exact', 'approx'} [default='auto']

     Definition Classes
       BoosterParams

109. #### val uid: String

     Definition Classes
       XGBoostRegressionModel → Identifiable

110. #### final val useExternalMemory: BooleanParam

     Definition Classes
       XGBoostModel

111. #### def validateAndTransformSchema(schema: StructType, fitting: Boolean, featuresDataType: DataType): StructType

     Attributes
       protected
     Definition Classes
       PredictorParams

112. #### def version: Int

     Definition Classes
       XGBoostModel

113. #### final def wait(): Unit

     Definition Classes
       AnyRef
     Annotations
       @throws( ... )

114. #### final def wait(arg0: Long, arg1: Int): Unit

     Definition Classes
       AnyRef
     Annotations
       @throws( ... )

115. #### final def wait(arg0: Long): Unit

     Definition Classes
       AnyRef
     Annotations
       @throws( ... )

116. #### def write: MLWriter

     Definition Classes
       XGBoostModel → MLWritable

### Inherited from XGBoostModel

### Inherited from MLWritable

### Inherited from BoosterParams

### Inherited from PredictionModel[Vector, XGBoostModel]

### Inherited from PredictorParams

### Inherited from HasPredictionCol

### Inherited from HasFeaturesCol

### Inherited from HasLabelCol

### Inherited from Model[XGBoostModel]

### Inherited from Transformer

### Inherited from PipelineStage

### Inherited from Logging

### Inherited from Params

### Inherited from Serializable

### Inherited from Identifiable

### Inherited from AnyRef

### Inherited from Any

### Ungrouped