source: orange/docs/reference/rst/code/ensemble-forest2.py @ 10633:fb05a6f3a235

Revision 10633:fb05a6f3a235, 614 bytes checked in by mstajdohar, 2 years ago (diff)

Changed obsolete names.

Line 
1# Description: Defines a tree learner (trunks of depth less than 5) and uses them in forest tree, prints out the number of nodes in each tree
2# Category:    classification, ensembles
3# Classes:     RandomForestLearner
4# Uses:        bupa.tab
5# Referenced:  orngEnsemble.htm
6
7import Orange
8
9bupa = Orange.data.Table('bupa.tab')
10
11tree = Orange.classification.tree.TreeLearner()
12tree.min_instances = 5
13tree.max_depth = 5
14
15forest_learner = Orange.ensemble.forest.RandomForestLearner(base_learner=tree, trees=50, attributes=3)
16forest = forest_learner(bupa)
17
18for c in forest.classifiers:
19    print c.countNodes(),
20print
Note: See TracBrowser for help on using the repository browser.