From 9e67c9cfbbe6979100fcd1bf80c8bc5ba61b31fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavlin=20Poli=C4=8Dar?= Date: Sun, 1 Jan 2017 17:13:10 +0100 Subject: [PATCH 1/2] OWPythagoreanForest: Implement main --- .../widgets/visualize/owpythagoreanforest.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Orange/widgets/visualize/owpythagoreanforest.py b/Orange/widgets/visualize/owpythagoreanforest.py index c6a4ab900f2..eb7349636b1 100644 --- a/Orange/widgets/visualize/owpythagoreanforest.py +++ b/Orange/widgets/visualize/owpythagoreanforest.py @@ -428,3 +428,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_() From 3ec0e494b1c0584a1c5309dde162e7b2ee3ae106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavlin=20Poli=C4=8Dar?= Date: Sun, 1 Jan 2017 17:17:10 +0100 Subject: [PATCH 2/2] OWPythagoreanForest: Disable size combo box while drawing trees --- Orange/widgets/visualize/owpythagoreanforest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Orange/widgets/visualize/owpythagoreanforest.py b/Orange/widgets/visualize/owpythagoreanforest.py index eb7349636b1..0af9a817c35 100644 --- a/Orange/widgets/visualize/owpythagoreanforest.py +++ b/Orange/widgets/visualize/owpythagoreanforest.py @@ -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: @@ -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):