Ignore:
Timestamp:
11/14/12 13:09:26 (17 months ago)
Author:
Miha Stajdohar <miha.stajdohar@…>
Branch:
default
rebase_source:
e93acb1373615b75d8bff7e0f362efc20e6ea83f
Message:

Added a common documentation index.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/tutorial/rst/association-rules.rst

    r9994 r11028  
    117117   0.898   0.429   1.116   fuel-type=gas num-of-doors=four -> aspiration=std engine-location=front 
    118118    
    119 Finally, for our third example, we introduce cloning. Cloning helps if 
    120 you require to work with different rule subsets that stem from common 
    121 rule set created from some data (actually, cloning is quite useless in 
    122 our example, but may be very useful otherwise). So, we use cloning to 
    123 make a copy of the set of rules, then sort by first support and then 
    124 confidence, and then print out few best rules. We have also lower 
    125 required minimal support, just to see how many rules we obtain in this 
    126 way (:download:`assoc3.py <code/assoc3.py>`, :download:`imports-85.tab <code/imports-85.tab>`):: 
    127  
    128    minSupport = 0.2 
    129    rules = orngAssoc.build(data, minSupport) 
    130    print "%i rules with support higher than or equal to %5.3f found.\n" % (len(rules), minSupport) 
    131     
    132    rules2 = rules.clone() 
    133    rules2.sortByConfidence() 
    134     
    135    n = 5 
    136    print "Best %i rules:" % n 
    137    subset = rules[:n] 
    138    subset.printMeasures(['support','confidence']) 
    139  
    140 The output of this script is:: 
    141  
    142    828 rules with support higher than or equal to 0.200 found. 
    143     
    144    Best 5 rules: 
    145    supp    conf    rule 
    146    0.888   0.984   engine-location=front -> fuel-type=gas 
    147    0.888   0.901   fuel-type=gas -> engine-location=front 
    148    0.805   0.982   engine-location=front -> aspiration=std 
    149    0.805   0.817   aspiration=std -> engine-location=front 
    150    0.785   0.958   fuel-type=gas -> aspiration=std 
    151  
    152  
Note: See TracChangeset for help on using the changeset viewer.