@@ -2070,40 +2070,10 @@ double Manthan::train(const vector<sample>& orig_samples, const uint32_t v) {
20702070 train_error = 0.0 ;
20712071 } else {
20722072 // Create the RandomForest object and train it on the training data.
2073- //
2074- // All Available Parameters to Reduce Overfitting:
2075- /* 1. minimumLeafSize (default: 10) */
2076- /* - Minimum number of points in each leaf node */
2077- /* - Increase to reduce overfitting (e.g., 20, 50, 100) */
2078- /* 2. minimumGainSplit (default: 1e-7) */
2079- /* - Minimum gain required for a node to split */
2080- /* - Increase to reduce overfitting (e.g., 0.001, 0.01, 0.05) */
2081- /* - Must be in range (0, 1) */
2082- /* 3. maximumDepth (default: 0 = unlimited) */
2083- /* - Maximum depth of the tree */
2084- /* - Set a limit to reduce overfitting (e.g., 5, 10, 15) */
2085- /* 4. dimensionSelector (optional) */
2086- /* - Advanced: Controls which features to consider for splitting */
2087- /* - Can use custom strategies (usually leave as default) */
2088-
2089- /* DecisionTree<> r(dataset, labels, 2); */
2090- // More conservative (less overfitting)
2091- /* DecisionTree<FitnessFunction, -- default is GiniGain */
2092- /* NumericSplitType, */
2093- /* CategoricalSplitType, */
2094- /* DimensionSelectionType, */
2095- /* NoRecursion>::DecisionTree( */
2096- /* MatType data, */
2097- /* LabelsType labels, */
2098- /* const size_t numClasses, */
2099- /* const size_t minimumLeafSize, */
2100- /* const double minimumGainSplit, */
2101- /* const size_t maximumDepth, */
2102- /* DimensionSelectionType dimensionSelector) */
21032073 mlpack::DecisionTree<> r (dataset, labels, 2 ,
2104- mconf.min_leaf_size , // minimumLeafSize: require 20+ samples per leaf (default 10)
2105- mconf.min_gain_split , // minimumGainSplit: require k ratio gain to split
2106- mconf.max_depth ); // maximumDepth: max k levels deep (0 = unlimited)
2074+ mconf.min_leaf_size , // minimumLeafSize: require 20+ samples per leaf (default 10)
2075+ mconf.min_gain_split , // minimumGainSplit: require k ratio gain to split
2076+ mconf.max_depth ); // maximumDepth: max k levels deep (0 = unlimited)
21072077
21082078 // Compute and print the training error.
21092079 arma::Row<size_t > predictions;
0 commit comments