source: orange/Orange/doc/modules/classification_rules1.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 661 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1import orange
2import orngCN2
3
4data = orange.ExampleTable("titanic.tab")
5
6# create learner
7learner = orange.RuleLearner()
8
9cl = learner(data)
10for r in cl.rules:
11    print orngCN2.ruleToString(r)
12print "*****"
13
14learner.ruleFinder = orange.RuleBeamFinder()
15learner.ruleFinder.evaluator = orngCN2.mEstimate(m=50)
16
17cl = learner(data)
18for r in cl.rules:
19    print orngCN2.ruleToString(r)
20print "****"
21
22learner.ruleFinder.ruleStoppingValidator = orange.RuleValidator_LRS(alpha=0.01,min_coverage=10,max_rule_complexity = 2)
23learner.ruleFinder.ruleFilter = orange.RuleBeamFilter_Width(width = 50)
24
25cl = learner(data)
26for r in cl.rules:
27    print orngCN2.ruleToString(r)
Note: See TracBrowser for help on using the repository browser.