source: orange/docs/tutorial/rst/code/assoc1.py @ 11054:eca373fb96a9

Revision 11054:eca373fb96a9, 609 bytes checked in by blaz <blaz.zupan@…>, 16 months ago (diff)

new tutorial (refresh after removal of old files)

Line 
1import orngAssoc
2import Orange
3
4data = Orange.data.Table("imports-85")
5data = Orange.data.Table("zoo")
6#data = Orange.data.preprocess.Discretize(data, \
7#  method=Orange.data.discretization.EqualFreq(numberOfIntervals=3))
8# data = data.select(range(10))
9
10rules = Orange.associate.AssociationRulesInducer(data, support=0.4)
11
12print "%i rules with support higher than or equal to %5.3f found.\n" % (len(rules), 0.4)
13
14orngAssoc.sort(rules, ["support", "confidence"])
15
16orngAssoc.printRules(rules[:5], ["support", "confidence"])
17print
18
19del rules[:3]
20orngAssoc.printRules(rules[:5], ["support", "confidence"])
21print
Note: See TracBrowser for help on using the repository browser.