Skip to content

Commit

Permalink
Tree: Fix crash when two attributes have too many values for binariza…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
janezd committed Jan 17, 2017
1 parent 463242d commit 16f6de3
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 16f6de3

Please sign in to comment.