class Booster extends Serializable with KryoSerializable
Booster for xgboost, this is a model API that support interactive build of a XGBoost Model
DEVELOPER WARNING: A Java Booster must not be shared by more than one Scala Booster
- Alphabetic
- By Inheritance
- Booster
- KryoSerializable
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
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
- Annotations
- @throws( classOf[XGBoostError] )
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
dispose: Unit
Dispose the booster when it is no longer needed
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
evalSet(evalMatrixs: Array[DMatrix], evalNames: Array[String], eval: EvalTrait): 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
- Annotations
- @throws( classOf[XGBoostError] )
-
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
- Annotations
- @throws( classOf[XGBoostError] )
-
def
finalize(): Unit
- Definition Classes
- Booster → AnyRef
-
def
getAttr(key: String): String
Get attribute from the Booster.
Get attribute from the Booster.
- key
attr name
- returns
attr value
- Annotations
- @throws( classOf[XGBoostError] )
-
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.
- Annotations
- @throws( classOf[XGBoostError] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getFeatureScore(featureNames: Array[String]): Map[String, Integer]
Get importance of each feature based on weight only (number of splits), with specified feature names.
Get importance of each feature based on weight only (number of splits), with specified feature names.
- returns
featureScoreMap key: feature name, value: feature importance score
- Annotations
- @throws( classOf[XGBoostError] )
-
def
getFeatureScore(featureMap: String = null): Map[String, Integer]
Get importance of each feature based on weight only (number of splits)
Get importance of each feature based on weight only (number of splits)
- returns
featureScoreMap key: feature index, value: feature importance score
- Annotations
- @throws( classOf[XGBoostError] )
- def getModelDump(featureNames: Array[String], withStats: Boolean, format: String): Array[String]
-
def
getModelDump(featureNames: Array[String]): Array[String]
Dump model as Array of string with specified feature names.
Dump model as Array of string with specified feature names.
- featureNames
Names of features.
- Annotations
- @throws( classOf[XGBoostError] )
-
def
getModelDump(featureMap: String = null, withStats: Boolean = false, format: String = "text"): Array[String]
Dump model as Array of string
Dump model as Array of string
- featureMap
featureMap file
- withStats
bool Controls whether the split statistics are output.
- Annotations
- @throws( classOf[XGBoostError] )
- def getNumBoostedRound: Long
-
def
getNumFeature: Long
Get the number of model features.
Get the number of model features.
- returns
number of features
- Annotations
- @throws( classOf[XGBoostError] )
-
def
getScore(featureNames: Array[String], importanceType: String): Map[String, Double]
Get importance of each feature based on information gain or cover , with specified feature names.
Get importance of each feature based on information gain or cover , with specified feature names. Supported: ["gain, "cover", "total_gain", "total_cover"]
- returns
featureScoreMap key: feature name, value: feature importance score
- Annotations
- @throws( classOf[XGBoostError] )
-
def
getScore(featureMap: String, importanceType: String): Map[String, Double]
Get importance of each feature based on information gain or cover Supported: ["gain, "cover", "total_gain", "total_cover"]
Get importance of each feature based on information gain or cover Supported: ["gain, "cover", "total_gain", "total_cover"]
- returns
featureScoreMap key: feature index, value: feature importance score
- Annotations
- @throws( classOf[XGBoostError] )
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
predict(data: DMatrix, outPutMargin: Boolean = false, treeLimit: Int = 0): Array[Array[Float]]
Predict with data
Predict with data
- data
dmatrix storing the input
- outPutMargin
Whether to output the raw untransformed margin value.
- treeLimit
Limit number of trees in the prediction; defaults to 0 (use all trees).
- returns
predict result
- Annotations
- @throws( classOf[XGBoostError] )
-
def
predictContrib(data: DMatrix, treeLimit: Int = 0): Array[Array[Float]]
Output feature contributions toward predictions of given data
Output feature contributions toward predictions of given data
- data
dmatrix storing the input
- treeLimit
Limit number of trees in the prediction; defaults to 0 (use all trees).
- returns
The feature contributions and bias.
- Annotations
- @throws( classOf[XGBoostError] )
- Exceptions thrown
XGBoostError
native error
-
def
predictLeaf(data: DMatrix, treeLimit: Int = 0): Array[Array[Float]]
Predict the leaf indices
Predict the leaf indices
- data
dmatrix storing the input
- treeLimit
Limit number of trees in the prediction; defaults to 0 (use all trees).
- returns
predict result
- Annotations
- @throws( classOf[XGBoostError] )
- Exceptions thrown
XGBoostError
native error
-
def
read(kryo: Kryo, input: Input): Unit
- Definition Classes
- Booster → KryoSerializable
-
def
saveModel(out: OutputStream, format: String): Unit
save model to Output stream
save model to Output stream
- out
output stream
- format
the supported model format, (json, ubj, deprecated)
- Annotations
- @throws( classOf[XGBoostError] )
- Exceptions thrown
-
def
saveModel(out: OutputStream): Unit
save model to Output stream
save model to Output stream
- out
Output stream
- Annotations
- @throws( classOf[XGBoostError] )
-
def
saveModel(modelPath: String): Unit
save model to modelPath
save model to modelPath
- modelPath
model path
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setAttr(key: String, value: String): Unit
Set attribute to the Booster.
Set attribute to the Booster.
- key
attr name
- value
attr value
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setAttrs(params: Map[String, String]): Unit
set attributes
set attributes
- params
attributes key-value map
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setParam(key: String, value: AnyRef): Unit
Set parameter to the Booster.
Set parameter to the Booster.
- key
param name
- value
param value
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setParams(params: Map[String, AnyRef]): Unit
set parameters
set parameters
- params
parameters key-value map
- Annotations
- @throws( classOf[XGBoostError] )
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toByteArray: Array[Byte]
Save model into a raw byte array in the UBJSON ("ubj") format.
Save model into a raw byte array in the UBJSON ("ubj") format.
- Annotations
- @throws( classOf[XGBoostError] )
-
def
toByteArray(format: String): Array[Byte]
Save model into a raw byte array.
Save model into a raw byte array. Available options are "json", "ubj" and "deprecated".
- Annotations
- @throws( classOf[XGBoostError] )
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
update(dtrain: DMatrix, iter: Int, obj: ObjectiveTrait): Unit
update with customize obj func
update with customize obj func
- dtrain
training data
- iter
The current training iteration
- obj
customized objective class
- Annotations
- @throws( classOf[XGBoostError] )
-
def
update(dtrain: DMatrix, iter: Int): Unit
Update (one iteration)
Update (one iteration)
- dtrain
training data
- iter
current iteration number
- Annotations
- @throws( classOf[XGBoostError] )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
write(kryo: Kryo, output: Output): Unit
- Definition Classes
- Booster → KryoSerializable
Deprecated Value Members
-
def
boost(dtrain: DMatrix, grad: Array[Float], hess: Array[Float]): Unit
- Annotations
- @throws( classOf[XGBoostError] ) @deprecated
- Deprecated
-
def
update(dtrain: DMatrix, obj: ObjectiveTrait): Unit
- Annotations
- @throws( classOf[XGBoostError] ) @deprecated
- Deprecated