C# Class LightGBMNet.Train.Booster

Wrapper of Booster object of LightGBM.
Inheritance: IDisposable
Show file Open project: rca22/LightGBM.Net Class Usage Examples

Private Properties

Property Type Description
Booster System
Eval double
GetDefaultValue double[]
GetHasMissing bool
GetIsCategoricalSplit bool
GetIsDefaultLeft bool
GetModel System
GetModelJSON string
NextDown double
NextUp double
Str2DoubleArray double[]
Str2IntArray int[]
Str2UIntArray uint[]

Public Methods

Method Description
Booster ( Parameters parameters, LightGBMNet.Train.Dataset trainset, LightGBMNet.Train.Dataset validset = null ) : System
CalcNumPredict ( int numRow, PredictType predType, int numIteration ) : long
Clone ( ) : Booster

Clones the Booster object

Dispose ( ) : void
EvalTrain ( ) : double
EvalValid ( ) : double
FromFile ( string fileName ) : Booster
FromString ( string model ) : Booster
GetFeatureImportance ( int numIteration, ImportanceType importanceType ) : double[]
GetLeafValue ( int treeIdx, int leafIdx ) : double
GetModelString ( ) : string
GetNumPredict ( int dataIdx ) : long
GetPredict ( int dataIdx ) : double[]
MergeWith ( Booster other ) : void
PredictForMat ( PredictType predictType, Array data, int startIteration, int numIteration ) : double[]
PredictForMats ( PredictType predictType, Array data, int startIteration, int numIteration, int numThreads ) : double[]
PredictForMatsMulti ( PredictType predictType, Array data, int startIteration, int numIteration ) : ].double[
Refit ( ].int[ leafPreds ) : void
ResetParameter ( Parameters pms ) : void
ResetTrainingData ( Dataset trainset ) : void
RollbackOneIter ( ) : void
SaveModel ( int startIteration, int numIteration, string fileName ) : void
SetLeafValue ( int treeIdx, int leafIdx, double val ) : void
SetLearningRate ( double learningRate ) : void
ShuffleModels ( ) : void
Update ( ) : bool
UpdateCustom ( Array grad, Array hess ) : bool

Private Methods

Method Description
Booster ( IntPtr h, int bestIteration ) : System
Eval ( int dataIdx ) : double
GetDefaultValue ( Array threshold, Array decisionType ) : double[]
GetHasMissing ( uint decisionType ) : bool
GetIsCategoricalSplit ( uint decisionType ) : bool
GetIsDefaultLeft ( uint decisionType ) : bool
GetModel ( ) : System
GetModelJSON ( int startIteration, int numIteration ) : string
NextDown ( double x ) : double
NextUp ( double x ) : double
Str2DoubleArray ( string str, Array delimiters ) : double[]
Str2IntArray ( string str, Array delimiters ) : int[]
Str2UIntArray ( string str, Array delimiters ) : uint[]

Method Details

Booster() public method

public Booster ( Parameters parameters, LightGBMNet.Train.Dataset trainset, LightGBMNet.Train.Dataset validset = null ) : System
parameters Parameters
trainset LightGBMNet.Train.Dataset
validset LightGBMNet.Train.Dataset
return System

CalcNumPredict() public method

public CalcNumPredict ( int numRow, PredictType predType, int numIteration ) : long
numRow int
predType PredictType
numIteration int
return long

Clone() public method

Clones the Booster object
public Clone ( ) : Booster
return Booster

Dispose() public method

public Dispose ( ) : void
return void

EvalTrain() public method

public EvalTrain ( ) : double
return double

EvalValid() public method

public EvalValid ( ) : double
return double

FromFile() public static method

public static FromFile ( string fileName ) : Booster
fileName string
return Booster

FromString() public static method

public static FromString ( string model ) : Booster
model string
return Booster

GetFeatureImportance() public method

public GetFeatureImportance ( int numIteration, ImportanceType importanceType ) : double[]
numIteration int
importanceType ImportanceType
return double[]

GetLeafValue() public method

public GetLeafValue ( int treeIdx, int leafIdx ) : double
treeIdx int
leafIdx int
return double

GetModelString() public method

public GetModelString ( ) : string
return string

GetNumPredict() public method

public GetNumPredict ( int dataIdx ) : long
dataIdx int
return long

GetPredict() public method

public GetPredict ( int dataIdx ) : double[]
dataIdx int
return double[]

MergeWith() public method

public MergeWith ( Booster other ) : void
other Booster
return void

PredictForMat() public method

public PredictForMat ( PredictType predictType, Array data, int startIteration, int numIteration ) : double[]
predictType PredictType
data Array
startIteration int
numIteration int
return double[]

PredictForMats() public method

public PredictForMats ( PredictType predictType, Array data, int startIteration, int numIteration, int numThreads ) : double[]
predictType PredictType
data Array
startIteration int
numIteration int
numThreads int
return double[]

PredictForMatsMulti() public method

public PredictForMatsMulti ( PredictType predictType, Array data, int startIteration, int numIteration ) : ].double[
predictType PredictType
data Array
startIteration int
numIteration int
return ].double[

Refit() public method

public Refit ( ].int[ leafPreds ) : void
leafPreds ].int[
return void

ResetParameter() public method

public ResetParameter ( Parameters pms ) : void
pms Parameters
return void

ResetTrainingData() public method

public ResetTrainingData ( Dataset trainset ) : void
trainset Dataset
return void

RollbackOneIter() public method

public RollbackOneIter ( ) : void
return void

SaveModel() public method

public SaveModel ( int startIteration, int numIteration, string fileName ) : void
startIteration int
numIteration int
fileName string
return void

SetLeafValue() public method

public SetLeafValue ( int treeIdx, int leafIdx, double val ) : void
treeIdx int
leafIdx int
val double
return void

SetLearningRate() public method

public SetLearningRate ( double learningRate ) : void
learningRate double
return void

ShuffleModels() public method

public ShuffleModels ( ) : void
return void

Update() public method

public Update ( ) : bool
return bool

UpdateCustom() public method

public UpdateCustom ( Array grad, Array hess ) : bool
grad Array
hess Array
return bool