From fd43668cdaffc1271063a5fa5ce3e17c673181b5 Mon Sep 17 00:00:00 2001 From: Rishabh Garg <56191449+RishabhGarg108@users.noreply.github.com> Date: Wed, 17 Mar 2021 18:43:20 +0530 Subject: [PATCH] Added WarmStart template parameter --- .../methods/random_forest/random_forest.hpp | 2 +- .../random_forest/random_forest_impl.hpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mlpack/methods/random_forest/random_forest.hpp b/src/mlpack/methods/random_forest/random_forest.hpp index b297f8a5ef..23673a9592 100644 --- a/src/mlpack/methods/random_forest/random_forest.hpp +++ b/src/mlpack/methods/random_forest/random_forest.hpp @@ -359,7 +359,7 @@ class RandomForest * @tparam MatType The type of data matrix (i.e. arma::mat). * @return The average entropy of all the decision trees trained under forest. */ - template + template double Train(const MatType& data, const data::DatasetInfo& datasetInfo, const arma::Row& labels, diff --git a/src/mlpack/methods/random_forest/random_forest_impl.hpp b/src/mlpack/methods/random_forest/random_forest_impl.hpp index 124199ee8a..d79b252791 100644 --- a/src/mlpack/methods/random_forest/random_forest_impl.hpp +++ b/src/mlpack/methods/random_forest/random_forest_impl.hpp @@ -44,7 +44,7 @@ RandomForest< // Pass off work to the Train() method. data::DatasetInfo info; // Ignored. arma::rowvec weights; // Fake weights, not used. - Train(dataset, info, labels, numClasses, weights, numTrees, + Train(dataset, info, labels, numClasses, weights, numTrees, minimumLeafSize, minimumGainSplit, maximumDepth, dimensionSelector); } @@ -74,7 +74,7 @@ RandomForest< { // Pass off work to the Train() method. arma::rowvec weights; // Fake weights, not used. - Train(dataset, datasetInfo, labels, numClasses, weights, + Train(dataset, datasetInfo, labels, numClasses, weights, numTrees, minimumLeafSize, minimumGainSplit, maximumDepth, dimensionSelector); } @@ -105,7 +105,7 @@ RandomForest< { // Pass off work to the Train() method. data::DatasetInfo info; // Ignored by Train(). - Train(dataset, info, labels, numClasses, weights, numTrees, + Train(dataset, info, labels, numClasses, weights, numTrees, minimumLeafSize, minimumGainSplit, maximumDepth, dimensionSelector); } @@ -135,7 +135,7 @@ RandomForest< DimensionSelectionType dimensionSelector) { // Pass off work to the Train() method. - Train(dataset, datasetInfo, labels, numClasses, weights, numTrees, + Train(dataset, datasetInfo, labels, numClasses, weights, numTrees, minimumLeafSize, minimumGainSplit, maximumDepth, dimensionSelector); } @@ -165,7 +165,7 @@ double RandomForest< // Pass off to Train(). data::DatasetInfo info; // Ignored by Train(). arma::rowvec weights; // Ignored by Train(). - return Train(dataset, info, labels, numClasses, weights, + return Train(dataset, info, labels, numClasses, weights, numTrees, minimumLeafSize, minimumGainSplit, maximumDepth, dimensionSelector); } @@ -196,7 +196,7 @@ double RandomForest< { // Pass off to Train(). arma::rowvec weights; // Ignored by Train(). - return Train(dataset, datasetInfo, labels, numClasses, weights, + return Train(dataset, datasetInfo, labels, numClasses, weights, numTrees, minimumLeafSize, minimumGainSplit, maximumDepth, dimensionSelector); } @@ -227,7 +227,7 @@ double RandomForest< { // Pass off to Train(). data::DatasetInfo info; // Ignored by Train(). - return Train(dataset, info, labels, numClasses, weights, + return Train(dataset, info, labels, numClasses, weights, numTrees, minimumLeafSize, minimumGainSplit, maximumDepth, dimensionSelector); } @@ -258,7 +258,7 @@ double RandomForest< DimensionSelectionType dimensionSelector) { // Pass off to Train(). - return Train(dataset, datasetInfo, labels, numClasses, weights, + return Train(dataset, datasetInfo, labels, numClasses, weights, numTrees, minimumLeafSize, minimumGainSplit, maximumDepth, dimensionSelector); } @@ -445,7 +445,7 @@ template< template class CategoricalSplitType, typename ElemType > -template +template double RandomForest< FitnessFunction, DimensionSelectionType,