Skip to content

Commit

Permalink
Merge pull request #1928 from janezd/tree-eq-num-val-bin
Browse files Browse the repository at this point in the history
[FIX] Tree: Fix crash when two attributes equal number of values
  • Loading branch information
lanzagar authored Jan 17, 2017
2 parents 463242d + 16f6de3 commit c3a6b16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Orange/widgets/classify/owclassificationtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def check_data(self):
if not self.binary_trees:
return True
max_values, max_attr = max(
((len(attr.values), attr)
((len(attr.values), attr.name)
for attr in self.data.domain.attributes if attr.is_discrete),
default=(0, None))
MAX_BINARIZATION = ClassificationTreeLearner.MAX_BINARIZATION
if max_values > MAX_BINARIZATION:
self.Error.cannot_binarize(
max_attr.name, max_values, MAX_BINARIZATION)
max_attr, max_values, MAX_BINARIZATION)
return False
return True

Expand Down

0 comments on commit c3a6b16

Please sign in to comment.