Clarify error message for min_samples_split.
@@ -185,14 +185,16 @@ class BaseDecisionTree(six.with_metaclass(ABCMeta, BaseEstimator)):
if isinstance(self.min_samples_split, (numbers.Integral, np.integer)):
if not 2 <= self.min_samples_split:
- raise ValueError("min_samples_split must be at least 2 "
- "or in (0, 1.0], got %s"
+ raise ValueError("min_samples_split must be an integer "
+ "greater than 1 or a float in (0.0, 1.0]; "
+ "got the integer %s"
% self.min_samples_split)
min_samples_split = self.min_samples_split
else: # float
if not 0. < self.min_samples_split <= 1.:
- raise ValueError("min_samples_split must be at least 2 "
- "or in (0, 1.0], got %s"
+ raise ValueError("min_samples_split must be an integer "
+ "greater than 1 or a float in (0.0, 1.0]; "
+ "got the float %s"
% self.min_samples_split)
min_samples_split = int(ceil(self.min_samples_split * n_samples))
min_samples_split = max(2, min_samples_split)
