Database Reference
In-Depth Information
How it works…
The Apriori algorithm looks for items that are often associated together within a transaction.
This can be used for things such as analyzing shopping patterns. In this case, we're viewing
the constellation of attributes related to each mushroom as a transaction, and we're using the
Apriori algorithm to see which traits are associated with which other traits.
The algorithm attempts to ind the premises that imply a set of consequences. For instance,
white veil colors (the premise) imply a partial veil type with a conidence of 1.0, so whenever
the premise is found, the consequence is also found. A white veil color also implies a free gill
attachment, but the conidence is 99 percent, so we know that these two aren't associated all
of the time.
The abbreviated data dump of the preceding traits isn't particularly legible, so here's the same
information as a table:
Premise
Consequence
Confidence
veil-color=w
veil-type=p
1.0000
gill-attachment=f
veil-type=p
1.0000
gill-attachment=f, veil-color=w
veil-type=p
1.0000
gill-attachment=f
veil-color=w
0.9990
gill-attachment=f, veil-type=p
veil-color=w
0.9990
gill-attachment=f
veil-type=p, veil-color=w
0.9990
veil-color=w
gill-attachment=f
0.9977
veil-type=p, veil-color=w
gill-attachment=f
0.9977
veil-color=w
gill-attachment=f, veil-type=p
0.9977
veil-type=p
veil-color=w
0.9754
From this, we can see that a white veil is associated with a partial veil type, a free gill
attachment is associated with a partial white veil, and so on. If we want more information,
we can request more rules using the rules parameter.
There's more…
The Weka documentation at http://weka.sourceforge.net/doc.dev/weka/
associations/Apriori.html has more information about the Apriori class and
its options
For more about the algorithm itself, see Wikipedia's page on the Apriori algorithm at
http://en.wikipedia.org/wiki/Apriori_algorithm
Search WWH ::




Custom Search