apriori-algorithm 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/apriori-algorithm.gemspec +3 -1
- data/lib/apriori.rb +1 -1
- data/lib/apriori/algorithm.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6bd91c25c4ecb55fb91063e0a472f2b712ed427
|
4
|
+
data.tar.gz: 77d13e2f652d05586204ac52abf35724c99a2ed9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5e9f32bba0446fe522c95ac26d1930086c83c7e7408fdfe24c2619453b25cd0dd7ba0b614b84fa8ca60afbb5eab816d8f7cf04f296453ce5739e98ce33ad56d
|
7
|
+
data.tar.gz: 0ab4e4c9020b60b3fa33071453621ce17c3a3eb7e9b3ae60b8a80f179ef5129d0522acd28b82cc85857bf34bee476c16a21e57a8f53512eeeb7856740064782a
|
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,6 +4,10 @@
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/apriori-algorithm.svg)](http://badge.fury.io/rb/apriori-algorithm)
|
8
|
+
|
9
|
+
[![Build Status](https://travis-ci.org/seratch/apriori-algorithm.svg)](https://travis-ci.org/seratch/apriori-algorithm)
|
10
|
+
|
7
11
|
Add this line to your application's Gemfile:
|
8
12
|
|
9
13
|
```ruby
|
data/apriori-algorithm.gemspec
CHANGED
@@ -4,13 +4,14 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'apriori'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
+
|
7
8
|
spec.name = "apriori-algorithm"
|
8
9
|
spec.version = Apriori::VERSION
|
9
10
|
spec.authors = ["Kazuhiro Sera"]
|
10
11
|
spec.email = ["seratch@gmail.com"]
|
11
12
|
spec.summary = %q{Apriori Algorithm implementation in Ruby}
|
12
13
|
spec.description = %q{Apriori Algorithm implementation in Ruby}
|
13
|
-
spec.homepage = ""
|
14
|
+
spec.homepage = "https://github.com/seratch/apriori-algorithm"
|
14
15
|
spec.license = "MIT"
|
15
16
|
|
16
17
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -22,4 +23,5 @@ Gem::Specification.new do |spec|
|
|
22
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
24
|
spec.add_development_dependency 'rspec'
|
24
25
|
spec.add_development_dependency 'guard-rspec'
|
26
|
+
|
25
27
|
end
|
data/lib/apriori.rb
CHANGED
data/lib/apriori/algorithm.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'apriori/analysis_result'
|
2
2
|
require 'apriori/association_rule'
|
3
3
|
require 'apriori/frequent_item_set'
|
4
|
+
require 'set'
|
4
5
|
|
5
6
|
#
|
6
7
|
# Apriori Algorithm(http://en.wikipedia.org/wiki/Apriori_algorithm) implementation in Ruby.
|
@@ -121,7 +122,7 @@ module Apriori
|
|
121
122
|
end
|
122
123
|
|
123
124
|
def to_all_sub_sets(item_set)
|
124
|
-
(1
|
125
|
+
(1...(item_set.length)).flat_map { |n| item_set.to_a.combination(n) }.first
|
125
126
|
end
|
126
127
|
|
127
128
|
def calculate_support(item_set, frequencies, transactions)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apriori-algorithm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuhiro Sera
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
77
78
|
- Gemfile
|
78
79
|
- Gemfile.lock
|
79
80
|
- Guardfile
|
@@ -89,7 +90,7 @@ files:
|
|
89
90
|
- spec/dataset.csv
|
90
91
|
- spec/spec_helper.rb
|
91
92
|
- spec/usage_spec.rb
|
92
|
-
homepage:
|
93
|
+
homepage: https://github.com/seratch/apriori-algorithm
|
93
94
|
licenses:
|
94
95
|
- MIT
|
95
96
|
metadata: {}
|