Class CARTRegressionTrainer
java.lang.Object
org.tribuo.common.tree.AbstractCARTTrainer<Regressor>
org.tribuo.regression.rtree.CARTRegressionTrainer
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>
,DecisionTreeTrainer<Regressor>
,SparseTrainer<Regressor>
,Trainer<Regressor>
,WeightedExamples
-
Nested Class Summary
Nested classes/interfaces inherited from class org.tribuo.common.tree.AbstractCARTTrainer
AbstractCARTTrainer.AbstractCARTTrainerProvenance
-
Field Summary
Fields inherited from class org.tribuo.common.tree.AbstractCARTTrainer
fractionFeaturesInSplit, maxDepth, MIN_EXAMPLES, minChildWeight, rng, seed, trainInvocationCounter
Fields inherited from interface org.tribuo.Trainer
DEFAULT_SEED
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a CART trainer.CARTRegressionTrainer
(int maxDepth) Creates a CART trainer.CARTRegressionTrainer
(int maxDepth, float minChildWeight, float fractionFeaturesInSplit, RegressorImpurity impurity, long seed) Creates a CART Trainer. -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractTrainingNode
<Regressor> mkTrainingNode
(Dataset<Regressor> examples) toString()
train
(Dataset<Regressor> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance) Trains a sparse predictive model using the examples in the given data set.Methods inherited from class org.tribuo.common.tree.AbstractCARTTrainer
getFractionFeaturesInSplit, getInvocationCount, postConfig, train
-
Constructor Details
-
CARTRegressionTrainer
public CARTRegressionTrainer(int maxDepth, float minChildWeight, float fractionFeaturesInSplit, RegressorImpurity impurity, long seed) Creates a CART Trainer.- Parameters:
maxDepth
- maxDepth The maximum depth of the tree.minChildWeight
- minChildWeight The minimum node weight to consider it for a split.fractionFeaturesInSplit
- fractionFeaturesInSplit The fraction of features available in each split.impurity
- impurity The impurity function to use to determine split quality.seed
- The RNG seed.
-
CARTRegressionTrainer
public CARTRegressionTrainer()Creates a CART trainer. Sets the impurity to theMeanSquaredError
, uses all the features, and sets the minimum number of examples in a leaf toAbstractCARTTrainer.MIN_EXAMPLES
. -
CARTRegressionTrainer
Creates a CART trainer. Sets the impurity to theMeanSquaredError
, uses all the features, and sets the minimum number of examples in a leaf toAbstractCARTTrainer.MIN_EXAMPLES
.- Parameters:
maxDepth
- The maximum depth of the tree.
-
-
Method Details
-
mkTrainingNode
- Specified by:
mkTrainingNode
in classAbstractCARTTrainer<Regressor>
-
train
public TreeModel<Regressor> train(Dataset<Regressor> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance) Description copied from interface:SparseTrainer
Trains a sparse predictive model using the examples in the given data set.- Specified by:
train
in interfaceSparseTrainer<Regressor>
- Specified by:
train
in interfaceTrainer<Regressor>
- Overrides:
train
in classAbstractCARTTrainer<Regressor>
- Parameters:
examples
- the data set containing the examples.runProvenance
- Training run specific provenance (e.g., fold number).- Returns:
- a predictive model that can be used to generate predictions for new examples.
-
toString
-
getProvenance
-