diff --git a/src/mlpack/methods/det/dtree_impl.hpp b/src/mlpack/methods/det/dtree_impl.hpp index 7df858e4d2..dfdb994049 100644 --- a/src/mlpack/methods/det/dtree_impl.hpp +++ b/src/mlpack/methods/det/dtree_impl.hpp @@ -874,19 +874,13 @@ double DTree::ComputeValue(const VecType& query) const } if (subtreeLeaves == 1) // If we are a leaf... - { return std::exp(std::log(ratio) - logVolume); - } - else - { - // Return either of the two children - left or right, depending on the - // splitValue - return (query[splitDim] <= splitValue) ? + + // Return either of the two children - left or right, depending on the + // splitValue. + return (query[splitDim] <= splitValue) ? left->ComputeValue(query) : right->ComputeValue(query); - } - - return 0.0; } // Index the buckets for possible usage later.