DecisionTreeTrain Method (Matrix, IntegerArray, IListDecisionTreeFactorType, Vector, Double, Int32, Boolean, Boolean, Boolean, RandomGenerator)
|
Build the decision tree CART classifier.
Namespace:
FinMath.MachineLearning
Assembly:
FinMath (in FinMath.dll) Version: 2.4.7-0a995bd0ea1854c2c868ec3f8dae606c5777e170
Syntax public void Train(
Matrix observations,
IntegerArray classes,
IList<DecisionTreeFactorType> factorTypes = null,
Vector weights = null,
double minimumObservationsNumber = 2,
int numFoldsPruning = 5,
bool doPrune = true,
bool useHeuristics = true,
bool useOneSERule = false,
RandomGenerator random = null
)
Parameters
- observations
- Type: FinMath.LinearAlgebraMatrix
Observation matrix (N*M size). Columns corresponds to factors, rows to observation. - classes
- Type: FinMath.DataStructuresIntegerArray
The vector (N size) class types. - factorTypes (Optional)
- Type: System.Collections.GenericIListDecisionTreeFactorType
The array (M size) factor types (Continuous by default). - weights (Optional)
- Type: FinMath.LinearAlgebraVector
The vector (N size) of any observation weight (ones by default). - minimumObservationsNumber (Optional)
- Type: SystemDouble
Minimum number of observations in at the terminal nodes (2 by default). - numFoldsPruning (Optional)
- Type: SystemInt32
Number of folds for minimal cost-complexity pruning (5 by default). - doPrune (Optional)
- Type: SystemBoolean
Is use minimal cost-complexity pruning (default true). - useHeuristics (Optional)
- Type: SystemBoolean
Is use heuristic search for nominal factors in multi-class problems (default true). - useOneSERule (Optional)
- Type: SystemBoolean
If use the 1SE rule to make final decision tree - prune thee more harsh (default false). - random (Optional)
- Type: FinMath.StatisticsRandomGenerator
Random number generator for cross-validation.
See Also