source: orange/docs/tutorial/rst/code/assoc1.py @ 9374:59bac7ddd8a2

Revision 9374:59bac7ddd8a2, 793 bytes checked in by mitar, 2 years ago (diff)

Tutorial documentation structure.

Line 
1# Description: Creates a list of association rules, selects five rules and prints them out
2# Category:    description
3# Uses:        imports-85
4# Classes:     orngAssoc.build, Preprocessor_discretize, EquiNDiscretization
5# Referenced:  assoc.htm
6
7import orange, orngAssoc
8
9data = orange.ExampleTable("imports-85")
10data = orange.Preprocessor_discretize(data, \
11  method=orange.EquiNDiscretization(numberOfIntervals=3))
12data = data.select(range(10))
13
14rules = orange.AssociationRulesInducer(data, support=0.4)
15
16print "%i rules with support higher than or equal to %5.3f found.\n" % (len(rules), 0.4)
17
18orngAssoc.sort(rules, ["support", "confidence"])
19
20orngAssoc.printRules(rules[:5], ["support", "confidence"])
21print
22
23del rules[:3]
24orngAssoc.printRules(rules[:5], ["support", "confidence"])
25print
Note: See TracBrowser for help on using the repository browser.