Skip to content

Commit

Permalink
Merge pull request #1851 from pavlin-policar/fix-pythagorean-forest-o…
Browse files Browse the repository at this point in the history
…verlap

Fix pythagorean forest overlap
  • Loading branch information
kernc authored Jan 3, 2017
2 parents f0e4ea3 + 3ec0e49 commit 8a6f524
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Orange/widgets/visualize/owpythagoreanforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ def _get_forest_adapter(self, model):
)

def _draw_trees(self):
self.ui_size_calc_combo.setEnabled(False)
self.grid_items, self.ptrees = [], []

with self.progressBar(len(self.forest_adapter.get_trees())) as prg:
Expand All @@ -253,6 +254,7 @@ def _draw_trees(self):
self.view.verticalScrollBar().width())
self.grid.reflow(width)
self.grid.setPreferredWidth(width)
self.ui_size_calc_combo.setEnabled(True)

@staticmethod
def _calculate_zoom(zoom_level):
Expand Down Expand Up @@ -428,3 +430,26 @@ def get_trees(self):
def domain(self):
"""Get the domain."""
return self._domain


if __name__ == '__main__':
from AnyQt.QtWidgets import QApplication
import sys

app = QApplication(sys.argv)
data = Table(sys.argv[1] if len(sys.argv) > 1 else 'iris')

if data.domain.has_discrete_class:
from Orange.classification.random_forest import RandomForestLearner
else:
from Orange.regression.random_forest import \
RandomForestRegressionLearner as RandomForestLearner
rf = RandomForestLearner()(data)
rf.instances = data

ow = OWPythagoreanForest()
ow.set_rf(rf)

ow.show()
ow.handleNewSignals()
app.exec_()

0 comments on commit 8a6f524

Please sign in to comment.