apriori 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,6 @@
1
+ == 0.2.2 2008-09-13
2
+ * updated all the docs for the association rules. preped the first gem
3
+
1
4
  == 0.2.1 2008-09-12
2
5
  * updated requirements to check for the proper rubygems version
3
6
 
data/README.txt CHANGED
@@ -68,15 +68,15 @@ This document is not an introduction to the Apriori algorithm. To find out more
68
68
  puts rules.join("\n")
69
69
 
70
70
  # Results:
71
- # doritos <- beer (33.3/2, 100.0)
72
- # beer <- doritos (50.0/3, 66.7)
73
- # apple <- doritos (50.0/3, 33.3)
74
- # doritos <- apple (66.7/4, 25.0)
75
- # apple <- cheese (50.0/3, 100.0)
76
- # cheese <- apple (66.7/4, 75.0)
71
+ # beer -> doritos (33.3/2, 100.0)
72
+ # doritos -> beer (50.0/3, 66.7)
73
+ # doritos -> apple (50.0/3, 33.3)
74
+ # apple -> doritos (66.7/4, 25.0)
75
+ # cheese -> apple (50.0/3, 100.0)
76
+ # apple -> cheese (66.7/4, 75.0)
77
77
 
78
78
  # NOTE:
79
- # doritos <- beer (33.3/2, 100.0)
79
+ # beer -> doritos (33.3/2, 100.0)
80
80
  # means:
81
81
  # * beer appears in 33.3% (2 total) of the transactions (the support)
82
82
  # * beer implies doritos 100% of the time (the confidence)
@@ -17,16 +17,16 @@ rules = Apriori.find_association_rules(transactions,
17
17
 
18
18
  puts rules.join("\n")
19
19
 
20
- # RETURNS:
21
- # doritos <- beer (33.3/2, 100.0)
22
- # beer <- doritos (50.0/3, 66.7)
23
- # apple <- doritos (50.0/3, 33.3)
24
- # doritos <- apple (66.7/4, 25.0)
25
- # apple <- cheese (50.0/3, 100.0)
26
- # cheese <- apple (66.7/4, 75.0)
20
+ # Results:
21
+ # beer -> doritos (33.3/2, 100.0)
22
+ # doritos -> beer (50.0/3, 66.7)
23
+ # doritos -> apple (50.0/3, 33.3)
24
+ # apple -> doritos (66.7/4, 25.0)
25
+ # cheese -> apple (50.0/3, 100.0)
26
+ # apple -> cheese (66.7/4, 75.0)
27
27
 
28
28
  # NOTE:
29
- # doritos <- beer (33.3/2, 100.0)
29
+ # beer -> doritos (33.3/2, 100.0)
30
30
  # means:
31
31
  # * beer appears in 33.3% (2 total) of the transactions (the support)
32
32
  # * beer implies doritos 100% of the time (the confidence)
@@ -41,6 +41,10 @@ module Apriori
41
41
  # Given +line+ returns an Itemset
42
42
  # Example of a line:
43
43
  # foo <- bar baz bangle (66.7/4, 75.0)
44
+ #
45
+ # Note that this is the opposite order of how apriori.rb returns the
46
+ # AssociationRule#to_s. (apriori.rb returns the antecedent on the left
47
+ # and consequent on the right)
44
48
  def parse_line(line)
45
49
  is = new
46
50
  line =~ /(.+)\s+<-\s+(.+?)\s+\((\d+\.\d)(?:\/(\d+))?,\s+(\d+\.\d)\)/
@@ -56,6 +60,10 @@ module Apriori
56
60
 
57
61
  # Returns the standard form of this rule as a string. For instance:
58
62
  # bar baz bangle -> foo (66.7/4, 75.0)
63
+ # # (antecedent) (consequent)
64
+ #
65
+ # Note that this order is the opposite order of the association rules returned by apriori.c
66
+ # I believe this format reads more naturally.
59
67
  def to_s
60
68
  # "%s <- %s (%0.01f%s, %0.01f)" % [ consequent,
61
69
  # antecedent.join(" "),
@@ -2,7 +2,7 @@ module Apriori
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -33,7 +33,7 @@
33
33
  <h1>apriori</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/apriori"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/apriori" class="numbers">0.2.1</a>
36
+ <a href="http://rubyforge.org/projects/apriori" class="numbers">0.2.2</a>
37
37
  <img src="images/2118201782_4e87521dc9_m.jpg" />
38
38
  </div>
39
39
  <h1>&#x2192; &#8216;find item associations&#8217;</h1>
@@ -47,7 +47,7 @@ large sets of transactions. This library provides a Ruby interface to Christian
47
47
  Borgelt&#8217;s C implementation of this algorithm.</p>
48
48
 
49
49
 
50
- <p>From Christian Borgelt&#8217;s Apriori:http://www.borgelt.net/apriori.html documentation:</p>
50
+ <p>From <a href="http://www.borgelt.net/apriori.html">Christian Borgelt&#8217;s Apriori</a> documentation:</p>
51
51
 
52
52
 
53
53
  <blockquote>
@@ -129,15 +129,15 @@ Borgelt&#8217;s C implementation of this algorithm.</p>
129
129
  <span class="ident">puts</span> <span class="ident">rules</span><span class="punct">.</span><span class="ident">join</span><span class="punct">(&quot;</span><span class="string"><span class="escape">\n</span></span><span class="punct">&quot;)</span>
130
130
 
131
131
  <span class="comment"># Results: </span>
132
- <span class="comment"># doritos &lt;- beer (33.3/2, 100.0)</span>
133
- <span class="comment"># beer &lt;- doritos (50.0/3, 66.7)</span>
134
- <span class="comment"># apple &lt;- doritos (50.0/3, 33.3)</span>
135
- <span class="comment"># doritos &lt;- apple (66.7/4, 25.0)</span>
136
- <span class="comment"># apple &lt;- cheese (50.0/3, 100.0)</span>
137
- <span class="comment"># cheese &lt;- apple (66.7/4, 75.0)</span>
132
+ <span class="comment"># beer -&gt; doritos (33.3/2, 100.0)</span>
133
+ <span class="comment"># doritos -&gt; beer (50.0/3, 66.7)</span>
134
+ <span class="comment"># doritos -&gt; apple (50.0/3, 33.3)</span>
135
+ <span class="comment"># apple -&gt; doritos (66.7/4, 25.0)</span>
136
+ <span class="comment"># cheese -&gt; apple (50.0/3, 100.0)</span>
137
+ <span class="comment"># apple -&gt; cheese (66.7/4, 75.0)</span>
138
138
 
139
139
  <span class="comment"># NOTE:</span>
140
- <span class="comment"># doritos &lt;- beer (33.3/2, 100.0)</span>
140
+ <span class="comment"># beer -&gt; doritos (33.3/2, 100.0)</span>
141
141
  <span class="comment"># means: </span>
142
142
  <span class="comment"># * beer appears in 33.3% (2 total) of the transactions (the support)</span>
143
143
  <span class="comment"># * beer implies doritos 100% of the time (the confidence)</span>
@@ -147,13 +147,16 @@ Borgelt&#8217;s C implementation of this algorithm.</p>
147
147
  <p>See the <ins>examples</ins> directory for more examples of usage.</p>
148
148
 
149
149
 
150
- <h2>Forum</h2>
150
+ <h2>Rdoc</h2>
151
151
 
152
152
 
153
- <p><a href="http://groups.google.com/group/apriori">http://groups.google.com/group/apriori</a></p>
153
+ <p><a href="http://apriori.rubyforge.org/rdoc/">View the rdoc here</a></p>
154
154
 
155
155
 
156
- <p><span class="caps">TODO</span> &#8211; create Google Group &#8211; apriori</p>
156
+ <h2>Mailing List</h2>
157
+
158
+
159
+ <p><a href="http://rubyforge.org/mail/?group_id=6948">Rubyforge Mailing List</a></p>
157
160
 
158
161
 
159
162
  <h2>How to submit patches</h2>
@@ -173,7 +176,7 @@ Borgelt&#8217;s C implementation of this algorithm.</p>
173
176
  rake test
174
177
  rake install_gem</pre>
175
178
 
176
- <p>h3.</p>
179
+ <h3><tt>add_development_dependency</tt> error</h3>
177
180
 
178
181
 
179
182
  <p>If you get the error:</p>
@@ -237,7 +240,7 @@ included in all copies or substantial portions of the Software.</p>
237
240
 
238
241
  <p>Comments are welcome. Send an email to <a href="mailto:nate@natemurray.com">Nate Murray</a> via the <a href="http://groups.google.com/group/apriori">forum</a></p>
239
242
  <p class="coda">
240
- <a href="nate@natemurray.com">Nate Murray</a>, 8th September 2008<br>
243
+ <a href="nate@natemurray.com">Nate Murray</a>, 18th September 2008<br>
241
244
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
242
245
  </p>
243
246
  </div>
@@ -9,7 +9,7 @@ Ruby Apriori is a library to efficiently find item association rules within
9
9
  large sets of transactions. This library provides a Ruby interface to Christian
10
10
  Borgelt's C implementation of this algorithm.
11
11
 
12
- From Christian Borgelt's Apriori:http://www.borgelt.net/apriori.html documentation:
12
+ From "Christian Borgelt's Apriori":http://www.borgelt.net/apriori.html documentation:
13
13
 
14
14
  bq. Association rule induction is a powerful method for so-called market basket
15
15
  analysis, which aims at finding regularities in the shopping behavior of
@@ -68,15 +68,15 @@ h2. Demonstration of usage
68
68
  puts rules.join("\n")
69
69
 
70
70
  # Results:
71
- # doritos <- beer (33.3/2, 100.0)
72
- # beer <- doritos (50.0/3, 66.7)
73
- # apple <- doritos (50.0/3, 33.3)
74
- # doritos <- apple (66.7/4, 25.0)
75
- # apple <- cheese (50.0/3, 100.0)
76
- # cheese <- apple (66.7/4, 75.0)
71
+ # beer -> doritos (33.3/2, 100.0)
72
+ # doritos -> beer (50.0/3, 66.7)
73
+ # doritos -> apple (50.0/3, 33.3)
74
+ # apple -> doritos (66.7/4, 25.0)
75
+ # cheese -> apple (50.0/3, 100.0)
76
+ # apple -> cheese (66.7/4, 75.0)
77
77
 
78
78
  # NOTE:
79
- # doritos <- beer (33.3/2, 100.0)
79
+ # beer -> doritos (33.3/2, 100.0)
80
80
  # means:
81
81
  # * beer appears in 33.3% (2 total) of the transactions (the support)
82
82
  # * beer implies doritos 100% of the time (the confidence)
@@ -84,11 +84,13 @@ h2. Demonstration of usage
84
84
 
85
85
  See the +examples+ directory for more examples of usage.
86
86
 
87
- h2. Forum
87
+ h2. Rdoc
88
88
 
89
- "http://groups.google.com/group/apriori":http://groups.google.com/group/apriori
89
+ "View the rdoc here":http://apriori.rubyforge.org/rdoc/
90
90
 
91
- TODO - create Google Group - apriori
91
+ h2. Mailing List
92
+
93
+ "Rubyforge Mailing List":http://rubyforge.org/mail/?group_id=6948
92
94
 
93
95
  h2. How to submit patches
94
96
 
@@ -102,7 +104,7 @@ h3. Build and test instructions
102
104
  rake test
103
105
  rake install_gem</pre>
104
106
 
105
- h3.
107
+ h3. <tt>add_development_dependency</tt> error
106
108
 
107
109
  If you get the error:
108
110
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apriori
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Murray