Packages

class LightGBMBooster extends Serializable

Represents a LightGBM Booster learner

Annotations
@SerialVersionUID()
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LightGBMBooster
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LightGBMBooster(model: String)

    Represents a LightGBM Booster learner

    Represents a LightGBM Booster learner

    model

    The string serialized representation of the learner

  2. new LightGBMBooster(trainDataset: LightGBMDataset, parameters: String)

    Represents a LightGBM Booster learner

    Represents a LightGBM Booster learner

    trainDataset

    The training dataset

    parameters

    The booster initialization parameters

  3. new LightGBMBooster(trainDataset: Option[LightGBMDataset] = None, parameters: Option[String] = None, modelStr: Option[String] = None)

    trainDataset

    The training dataset

    parameters

    The booster initialization parameters

    modelStr

    Optional parameter with the string serialized representation of the learner

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. def addValidationDataset(dataset: LightGBMDataset): Unit

    Adds the specified LightGBMDataset to be the validation dataset.

    Adds the specified LightGBMDataset to be the validation dataset.

    dataset

    The LightGBMDataset to add as the validation dataset.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. var bestIteration: Int
  7. lazy val boosterHandler: BoosterHandler
    Annotations
    @transient()
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  9. def dumpModel(session: SparkSession, filename: String, overwrite: Boolean): Unit

    Dumps the native model pointer to file.

    Dumps the native model pointer to file.

    session

    The spark session

    filename

    The name of the file to save the model to

    overwrite

    Whether to overwrite if the file already exists

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def featuresShap(features: Vector): Array[Double]
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def freeNativeMemory(): Unit

    Frees any native memory held by the underlying booster pointer.

  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def getEvalNames(): Array[String]

    Get the evaluation dataset column names from the native booster.

    Get the evaluation dataset column names from the native booster.

    returns

    The evaluation dataset column names.

  17. def getEvalResults(evalNames: Array[String], dataIndex: Int): Array[(String, Double)]

    Get the evaluation for the training data and validation data.

    Get the evaluation for the training data and validation data.

    evalNames

    The names of the evaluation metrics.

    dataIndex

    Index of data, 0: training data, 1: 1st validation data, 2: 2nd validation data and so on.

    returns

    Array of tuples containing the evaluation metric name and metric value.

  18. def getFeatureImportances(importanceType: String): Array[Double]

    Calls into LightGBM to retrieve the feature importances.

    Calls into LightGBM to retrieve the feature importances.

    importanceType

    Can be "split" or "gain"

    returns

    The feature importance values as an array.

  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def innerPredict(dataIndex: Int, classification: Boolean): Array[Array[Double]]

    Get predictions for the training and evaluation data on the booster.

    Get predictions for the training and evaluation data on the booster.

    dataIndex

    Index of data, 0: training data, 1: 1st validation data, 2: 2nd validation data and so on.

    classification

    Whether this is a classification scenario or not.

    returns

    The predictions as a 2D array where first level is for row index and second level is optional if there are classes.

  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. def mergeBooster(model: String): Unit

    Merges this Booster with the specified model.

    Merges this Booster with the specified model.

    model

    The string serialized representation of the learner to merge.

  23. val modelStr: Option[String]
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. lazy val numClasses: Int
  28. lazy val numFeatures: Int
  29. lazy val numModelPerIteration: Int
  30. lazy val numTotalIterations: Int
  31. lazy val numTotalModel: Int
  32. val parameters: Option[String]
  33. def predictForCSR(sparseVector: SparseVector, kind: Int, disableShapeCheck: Boolean, dataLengthLongPtr: SWIGTYPE_p_long_long, dataOutPtr: SWIGTYPE_p_double): Unit
    Attributes
    protected
  34. def predictForMat(row: Array[Double], kind: Int, disableShapeCheck: Boolean, dataLengthLongPtr: SWIGTYPE_p_long_long, dataOutPtr: SWIGTYPE_p_double): Unit
    Attributes
    protected
  35. def predictLeaf(features: Vector): Array[Double]
  36. def resetParameter(newParameters: String): Unit

    Reset the specified parameters on the native booster.

    Reset the specified parameters on the native booster.

    newParameters

    The new parameters to set.

  37. def saveNativeModel(session: SparkSession, filename: String, overwrite: Boolean): Unit

    Saves the native model serialized representation to file.

    Saves the native model serialized representation to file.

    session

    The spark session

    filename

    The name of the file to save the model to

    overwrite

    Whether to overwrite if the file already exists

  38. def saveToString(): String

    Saves the booster to string representation.

    Saves the booster to string representation.

    returns

    The serialized string representation of the Booster.

  39. def score(features: Vector, raw: Boolean, classification: Boolean, disableShapeCheck: Boolean): Array[Double]
  40. def setBestIteration(bestIteration: Int): Unit

    Sets the best iteration and also the numIterations to be the best iteration.

    Sets the best iteration and also the numIterations to be the best iteration.

    bestIteration

    The best iteration computed by early stopping.

  41. def setNumIterations(numIterations: Int): Unit

    Sets the total number of iterations used in the prediction.

    Sets the total number of iterations used in the prediction. If <= 0, all iterations from start_iteration are used (no limits).

    numIterations

    The total number of iterations used in the prediction.

  42. def setStartIteration(startIteration: Int): Unit

    Sets the start index of the iteration to predict.

    Sets the start index of the iteration to predict. If <= 0, starts from the first iteration.

    startIteration

    The start index of the iteration to predict.

  43. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  44. def toString(): String
    Definition Classes
    AnyRef → Any
  45. val trainDataset: Option[LightGBMDataset]
  46. def updateOneIteration(): Boolean

    Updates the booster for one iteration.

    Updates the booster for one iteration.

    returns

    True if terminated training early.

  47. def updateOneIterationCustom(gradient: Array[Float], hessian: Array[Float]): Boolean

    Updates the booster with custom loss function for one iteration.

    Updates the booster with custom loss function for one iteration.

    gradient

    The gradient from custom loss function.

    hessian

    The hessian matrix from custom loss function.

    returns

    True if terminated training early.

  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped