Example #1
0
def test():
    """Standalone test"""
    import sys
    from AnyQt.QtWidgets import QApplication
    from Orange.classification.tree import TreeLearner, SklTreeLearner
    from Orange.regression.tree import TreeLearner, SklTreeRegressionLearner
    a = QApplication(sys.argv)
    ow = OWTreeGraph()
    data = Table("titanic")
    # data = Table("housing")[:30]
    clf = SklTreeLearner()(data)
    # clf = TreeLearner()(data)
    clf.instances = data

    ow.ctree(clf)
    ow.show()
    ow.raise_()
    a.exec_()
    ow.saveSettings()
Example #2
0
def main():
    from AnyQt.QtWidgets import QApplication
    import sys

    app = QApplication(sys.argv)

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

    if data.domain.has_discrete_class:
        from Orange.classification.tree import SklTreeLearner as TreeLearner
    else:
        from Orange.regression.tree import SklTreeRegressionLearner as TreeLearner
    model = TreeLearner(max_depth=1000)(data)
    model.instances = data
    ow.set_tree(model)

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