Skip to content

Commit

Permalink
Merge pull request #2507 from lanzagar/treefix
Browse files Browse the repository at this point in the history
[FIX] tree: Fix min_samples_leaf check
  • Loading branch information
nikicc authored Jul 27, 2017
2 parents 59d3730 + 36b0968 commit 0e53f25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Orange/classification/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _score_disc():
cont = _tree_scorers.contingency(col_x, len(data.domain.attributes[attr_no].values),
data.Y, len(data.domain.class_var.values))
attr_distr = np.sum(cont, axis=0)
null_nodes = attr_distr <= self.min_samples_leaf
null_nodes = attr_distr < self.min_samples_leaf
# This is just for speed. If there is only a single non-null-node,
# entropy wouldn't decrease anyway.
if sum(null_nodes) >= n_values - 1:
Expand Down

0 comments on commit 0e53f25

Please sign in to comment.