diff --git a/src/mlpack/methods/decision_tree/best_binary_numeric_split.hpp b/src/mlpack/methods/decision_tree/best_binary_numeric_split.hpp index 657df344d9..3f5cd27e65 100644 --- a/src/mlpack/methods/decision_tree/best_binary_numeric_split.hpp +++ b/src/mlpack/methods/decision_tree/best_binary_numeric_split.hpp @@ -29,6 +29,10 @@ HAS_MEM_FUNC(BinaryScanInitialize, HasBinaryScanInitialize); // we can use with SFINAE to catch when a type has a BinaryStep(...) function. HAS_MEM_FUNC(BinaryStep, HasBinaryStep); +// This gives us a HasBinaryGains type (where U is a function pointer) +// we can use with SFINAE to catch when a type has a BinaryGains(...) function. +HAS_MEM_FUNC(BinaryGains, HasBinaryGains); + /** * The BestBinaryNumericSplit is a splitting function for decision trees that * will exhaustively search a numeric dimension for the best binary split. @@ -134,7 +138,9 @@ class BestBinaryNumericSplit HasBinaryScanInitialize::value && HasBinaryStep::value, + (const ResponsesType&, const WeightVecType&, const size_t)>::value && + HasBinaryGains(FitnessFunction::*)()>::value, double>::type SplitIfBetter( const double bestGain, diff --git a/src/mlpack/methods/decision_tree/best_binary_numeric_split_impl.hpp b/src/mlpack/methods/decision_tree/best_binary_numeric_split_impl.hpp index 1913fc0868..3d0ebdc078 100644 --- a/src/mlpack/methods/decision_tree/best_binary_numeric_split_impl.hpp +++ b/src/mlpack/methods/decision_tree/best_binary_numeric_split_impl.hpp @@ -327,7 +327,9 @@ typename std::enable_if< HasBinaryScanInitialize::value && HasBinaryStep::value, + (const ResponsesType&, const WeightVecType&, const size_t)>::value && + HasBinaryGains(FitnessFunction::*)()>::value, double>::type BestBinaryNumericSplit::SplitIfBetter( const double bestGain,