From e5935d4eb0d07ba9fd2e62c102e12c2fcafc28ff Mon Sep 17 00:00:00 2001 From: Rishabh Garg <56191449+RishabhGarg108@users.noreply.github.com> Date: Wed, 17 Mar 2021 18:51:00 +0530 Subject: [PATCH] Added warmStart to Train function definition --- src/mlpack/methods/random_forest/random_forest.hpp | 12 ++++++++---- .../methods/random_forest/random_forest_impl.hpp | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/mlpack/methods/random_forest/random_forest.hpp b/src/mlpack/methods/random_forest/random_forest.hpp index 23673a9592..f3aea15896 100644 --- a/src/mlpack/methods/random_forest/random_forest.hpp +++ b/src/mlpack/methods/random_forest/random_forest.hpp @@ -179,7 +179,8 @@ class RandomForest const double minimumGainSplit = 1e-7, const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = - DimensionSelectionType()); + DimensionSelectionType(), + bool warmStart = false); /** * Train the random forest on the given labeled training data with the given @@ -211,7 +212,8 @@ class RandomForest const double minimumGainSplit = 1e-7, const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = - DimensionSelectionType()); + DimensionSelectionType(), + bool warmStart = false); /** * Train the random forest on the given weighted labeled training data with @@ -241,7 +243,8 @@ class RandomForest const double minimumGainSplit = 1e-7, const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = - DimensionSelectionType()); + DimensionSelectionType(), + bool warmStart = false); /** * Train the random forest on the given weighted labeled training data with @@ -274,7 +277,8 @@ class RandomForest const double minimumGainSplit = 1e-7, const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = - DimensionSelectionType()); + DimensionSelectionType(), + bool warmStart = false); /** * Predict the class of the given point. If the random forest has not been diff --git a/src/mlpack/methods/random_forest/random_forest_impl.hpp b/src/mlpack/methods/random_forest/random_forest_impl.hpp index d79b252791..da2c6ef470 100644 --- a/src/mlpack/methods/random_forest/random_forest_impl.hpp +++ b/src/mlpack/methods/random_forest/random_forest_impl.hpp @@ -160,7 +160,8 @@ double RandomForest< const size_t minimumLeafSize, const double minimumGainSplit, const size_t maximumDepth, - DimensionSelectionType dimensionSelector) + DimensionSelectionType dimensionSelector, + bool warmStart) { // Pass off to Train(). data::DatasetInfo info; // Ignored by Train(). @@ -192,7 +193,8 @@ double RandomForest< const size_t minimumLeafSize, const double minimumGainSplit, const size_t maximumDepth, - DimensionSelectionType dimensionSelector) + DimensionSelectionType dimensionSelector, + bool warmStart) { // Pass off to Train(). arma::rowvec weights; // Ignored by Train(). @@ -223,7 +225,8 @@ double RandomForest< const size_t minimumLeafSize, const double minimumGainSplit, const size_t maximumDepth, - DimensionSelectionType dimensionSelector) + DimensionSelectionType dimensionSelector, + bool warmStart) { // Pass off to Train(). data::DatasetInfo info; // Ignored by Train(). @@ -255,7 +258,8 @@ double RandomForest< const size_t minimumLeafSize, const double minimumGainSplit, const size_t maximumDepth, - DimensionSelectionType dimensionSelector) + DimensionSelectionType dimensionSelector, + bool warmStart) { // Pass off to Train(). return Train(dataset, datasetInfo, labels, numClasses, weights,