Packages

class Booster extends Serializable with KryoSerializable

Booster for xgboost, this is a model API that support interactive build of a XGBoost Model

Linear Supertypes
KryoSerializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Booster
  2. KryoSerializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def boost(dtrain: DMatrix, iter: Int, grad: Array[Float], hess: Array[Float]): Unit

    Update with give grad and hess

    Update with give grad and hess

    dtrain

    training data

    iter

    The current training iteration.

    grad

    first order of gradient

    hess

    seconde order of gradient

    Exceptions thrown

    XGBoostError native error

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. def dispose(): Unit
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def evalSet(evalMatrixs: Array[DMatrix], evalNames: Array[String], eval: IEvaluation, metricsOut: Array[Float]): String
  11. def evalSet(evalMatrixs: Array[DMatrix], evalNames: Array[String], eval: IEvaluation): String

    evaluate with given customized Evaluation class

    evaluate with given customized Evaluation class

    evalMatrixs

    evaluation matrix

    evalNames

    evaluation names

    eval

    custom evaluator

    returns

    eval information

    Exceptions thrown

    XGBoostError native error

  12. def evalSet(evalMatrixs: Array[DMatrix], evalNames: Array[String], iter: Int, metricsOut: Array[Float]): String

    evaluate with given dmatrixs.

    evaluate with given dmatrixs.

    evalMatrixs

    dmatrixs for evaluation

    evalNames

    name for eval dmatrixs, used for check results

    iter

    current eval iteration

    metricsOut

    output array containing the evaluation metrics for each evalMatrix

    returns

    eval information

    Exceptions thrown

    XGBoostError native error

  13. def evalSet(evalMatrixs: Array[DMatrix], evalNames: Array[String], iter: Int): String

    evaluate with given dmatrixs.

    evaluate with given dmatrixs.

    evalMatrixs

    dmatrixs for evaluation

    evalNames

    name for eval dmatrixs, used for check results

    iter

    current eval iteration

    returns

    eval information

    Exceptions thrown

    XGBoostError native error

  14. def finalize(): Unit
    Attributes
    protected[java]
    Definition Classes
    Booster → AnyRef
    Annotations
    @Override()
  15. final def getAttr(key: String): String

    Get attribute from the Booster.

    Get attribute from the Booster.

    key

    attribute key

    returns

    attribute value

    Exceptions thrown

    XGBoostError native error

  16. final def getAttrs(): Map[String, String]

    Get attributes stored in the Booster as a Map.

    Get attributes stored in the Booster as a Map.

    returns

    A map contain attribute pairs.

    Exceptions thrown

    XGBoostError native error

  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def getFeatureNames(): Array[String]

    Get feature names from the Booster.

    Get feature names from the Booster.

    Exceptions thrown
  19. def getFeatureScore(featureMap: String): Map[String, Integer]

    Get importance of each feature

    Get importance of each feature

    returns

    featureScoreMap key: feature index, value: feature importance score, can be nill

    Exceptions thrown

    XGBoostError native error

  20. def getFeatureScore(featureNames: Array[String]): Map[String, Integer]

    Get importance of each feature with specified feature names.

    Get importance of each feature with specified feature names.

    returns

    featureScoreMap key: feature name, value: feature importance score, can be nill.

    Exceptions thrown

    XGBoostError native error

  21. final def getFeatureTypes(): Array[String]

    Get feature types from the Booster.

    Get feature types from the Booster.

    Exceptions thrown
  22. def getModelDump(featureNames: Array[String], withStats: Boolean, format: String): Array[String]
  23. def getModelDump(featureNames: Array[String], withStats: Boolean): Array[String]

    Get the dump of the model as a string array with specified feature names.

    Get the dump of the model as a string array with specified feature names.

    featureNames

    Names of the features.

    returns

    dumped model information

    Exceptions thrown
  24. def getModelDump(featureMap: String, withStats: Boolean, format: String): Array[String]
  25. def getModelDump(featureMap: String, withStats: Boolean): Array[String]

    Get the dump of the model as a string array

    Get the dump of the model as a string array

    withStats

    Controls whether the split statistics are output.

    returns

    dumped model information

    Exceptions thrown

    XGBoostError native error

  26. def getNumBoostedRound(): Int
  27. def getNumFeature(): Long

    Get number of model features.

    Get number of model features.

    returns

    the number of features.

    Exceptions thrown
  28. def getScore(featureMap: String, importanceType: String): Map[String, Double]

    Get the feature importances for gain or cover (average or total), with feature names

    Get the feature importances for gain or cover (average or total), with feature names

    returns

    featureImportanceMap key: feature name, values: feature importance score based on gain or cover

    Exceptions thrown

    XGBoostError native error

  29. def getScore(featureNames: Array[String], importanceType: String): Map[String, Double]

    Get the feature importances for gain or cover (average or total)

    Get the feature importances for gain or cover (average or total)

    returns

    featureImportanceMap key: feature index, values: feature importance score based on gain or cover

    Exceptions thrown

    XGBoostError native error

  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def inplace_predict(data: Array[Float], nrow: Int, ncol: Int, missing: Float, iteration_range: Array[Int], predict_type: PredictionType, base_margin: Array[Float]): Array[Array[Float]]

    Perform thread-safe prediction.

    Perform thread-safe prediction.

    data

    Flattened input matrix of features for prediction

    nrow

    The number of preditions to make (count of input matrix rows)

    ncol

    The number of features in the model (count of input matrix columns)

    missing

    Value indicating missing element in the data input matrix

    iteration_range

    Specifies which layer of trees are used in prediction. For example, if a random forest is trained with 100 rounds. Specifying iteration_range=[10, 20), then only the forests built during [10, 20) (half open set) rounds are used in this prediction.

    predict_type

    What kind of prediction to run.

    returns

    predict Result matrix

  32. def inplace_predict(data: Array[Float], nrow: Int, ncol: Int, missing: Float, iteration_range: Array[Int]): Array[Array[Float]]

    Perform thread-safe prediction.

    Perform thread-safe prediction.

    data

    Flattened input matrix of features for prediction

    nrow

    The number of preditions to make (count of input matrix rows)

    ncol

    The number of features in the model (count of input matrix columns)

    missing

    Value indicating missing element in the data input matrix

    iteration_range

    Specifies which layer of trees are used in prediction. For example, if a random forest is trained with 100 rounds. Specifying iteration_range=[10, 20), then only the forests built during [10, 20) (half open set) rounds are used in this prediction.

    returns

    predict Result matrix

  33. def inplace_predict(data: Array[Float], nrow: Int, ncol: Int, missing: Float): Array[Array[Float]]

    Perform thread-safe prediction.

    Perform thread-safe prediction.

    data

    Flattened input matrix of features for prediction

    nrow

    The number of preditions to make (count of input matrix rows)

    ncol

    The number of features in the model (count of input matrix columns)

    missing

    Value indicating missing element in the data input matrix

    returns

    predict Result matrix

  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. def predict(data: DMatrix, outputMargin: Boolean, treeLimit: Int): Array[Array[Float]]

    Advanced predict function with all the options.

    Advanced predict function with all the options.

    data

    data

    outputMargin

    output margin

    treeLimit

    limit number of trees, 0 means all trees.

    returns

    predict results

  39. def predict(data: DMatrix, outputMargin: Boolean): Array[Array[Float]]

    Predict with data

    Predict with data

    data

    data

    outputMargin

    output margin

    returns

    predict results

  40. def predict(data: DMatrix): Array[Array[Float]]

    Predict with data

    Predict with data

    data

    dmatrix storing the input

    returns

    predict result

    Exceptions thrown

    XGBoostError native error

  41. def predictContrib(data: DMatrix, treeLimit: Int): Array[Array[Float]]

    Output feature contributions toward predictions of given data

    Output feature contributions toward predictions of given data

    data

    The input data.

    treeLimit

    Number of trees to include, 0 means all trees.

    returns

    The feature contributions and bias.

    Exceptions thrown
  42. def predictLeaf(data: DMatrix, treeLimit: Int): Array[Array[Float]]

    Predict leaf indices given the data

    Predict leaf indices given the data

    data

    The input data.

    treeLimit

    Number of trees to include, 0 means all trees.

    returns

    The leaf indices of the instance.

    Exceptions thrown
  43. def read(kryo: Kryo, input: Input): Unit
    Definition Classes
    Booster → KryoSerializable
    Annotations
    @Override()
  44. def saveModel(out: OutputStream, format: String): Unit

    Save the model to file opened as output stream.

    Save the model to file opened as output stream. The model format is compatible with other xgboost bindings. The output stream can only save one xgboost model. This function will close the OutputStream after the save.

    out

    The output stream

    format

    The model format (ubj, json, deprecated)

    Exceptions thrown
  45. def saveModel(out: OutputStream): Unit

    Save the model to file opened as output stream.

    Save the model to file opened as output stream. The model format is compatible with other xgboost bindings. The output stream can only save one xgboost model. This function will close the OutputStream after the save.

    out

    The output stream

  46. def saveModel(modelPath: String): Unit

    Save model to modelPath

    Save model to modelPath

    modelPath

    model path

  47. final def setAttr(key: String, value: String): Unit

    Set attribute to the Booster.

    Set attribute to the Booster.

    key

    attribute key

    value

    attribute value

    Exceptions thrown

    XGBoostError native error

  48. def setAttrs(attrs: Map[String, String]): Unit

    Set attributes to the Booster.

    Set attributes to the Booster.

    attrs

    attributes key-value map

    Exceptions thrown

    XGBoostError native error

  49. def setFeatureNames(featureNames: Array[String]): Unit

    Set feature names to the Booster.

    Set feature names to the Booster.

    Exceptions thrown
  50. def setFeatureTypes(featureTypes: Array[String]): Unit

    Set feature types to the Booster.

    Set feature types to the Booster.

    Exceptions thrown
  51. final def setParam(key: String, value: Any): Unit

    Set parameter to the Booster.

    Set parameter to the Booster.

    key

    param name

    value

    param value

    Exceptions thrown

    XGBoostError native error

  52. def setParams(params: Map[String, AnyRef]): Unit

    Set parameters to the Booster.

    Set parameters to the Booster.

    params

    parameters key-value map

    Exceptions thrown

    XGBoostError native error

  53. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  54. def toByteArray(format: String): Array[Byte]

    Save model into raw byte array.

    Save model into raw byte array.

    format

    The output format. Available options are "json", "ubj" and "deprecated".

    returns

    the saved byte array

    Exceptions thrown

    XGBoostError native error

  55. def toByteArray(): Array[Byte]

    Save model into raw byte array in the UBJSON ("ubj") format.

    Save model into raw byte array in the UBJSON ("ubj") format.

    returns

    the saved byte array

    Exceptions thrown

    XGBoostError native error

  56. def toString(): String
    Definition Classes
    AnyRef → Any
  57. def update(dtrain: DMatrix, iter: Int, obj: IObjective): Unit

    Update with customize obj func

    Update with customize obj func

    dtrain

    training data

    iter

    The current training iteration.

    obj

    customized objective class

    Exceptions thrown

    XGBoostError native error

  58. def update(dtrain: DMatrix, iter: Int): Unit

    Update the booster for one iteration.

    Update the booster for one iteration.

    dtrain

    training data

    iter

    current iteration number

    Exceptions thrown

    XGBoostError native error

  59. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  62. def write(kryo: Kryo, output: Output): Unit
    Definition Classes
    Booster → KryoSerializable
    Annotations
    @Override()

Deprecated Value Members

  1. def boost(dtrain: DMatrix, grad: Array[Float], hess: Array[Float]): Unit
    Annotations
    @Deprecated
    Deprecated
  2. def update(dtrain: DMatrix, obj: IObjective): Unit
    Annotations
    @Deprecated
    Deprecated

Inherited from KryoSerializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped