diff --git a/src/mlpack/core/tree/rectangle_tree/x_tree_split_impl.hpp b/src/mlpack/core/tree/rectangle_tree/x_tree_split_impl.hpp index c977f0fecb..cc1119a845 100644 --- a/src/mlpack/core/tree/rectangle_tree/x_tree_split_impl.hpp +++ b/src/mlpack/core/tree/rectangle_tree/x_tree_split_impl.hpp @@ -435,7 +435,8 @@ bool XTreeSplit::SplitNonLeafNode(TreeType *tree, std::vector& relevels) bool useMinOverlapSplit = false; if (tiedOnOverlap) { - if (overlapBestAreaAxis / areaBestAreaAxis < MAX_OVERLAP) + if (MAX_OVERLAP > 0 && + overlapBestAreaAxis / areaBestAreaAxis < MAX_OVERLAP) { tree->numDescendants = 0; tree->bound.Clear();