combo_data 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -2
- data/combo_data.gemspec +1 -1
- data/lib/combo_data/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64a45ca20b228dedaaf1cdbd7261d1ff9909654e
|
4
|
+
data.tar.gz: 19dbece0dc1e4189ca6262a2120beeecdf2479c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb4683a0a6a121b8511aa0e6f605daa8ee15e3faeeb7b0fe26345c83a698d6802a3d4c7cdb5db2a83617c896a41b114d37c2d0c79478f5e762c94ef457882c9c
|
7
|
+
data.tar.gz: ff860f86d3c91bacc438071bdcc94764e77e6cab8f155fef2bcecc65fa4d229b9cb7d4aebdfc41ee0a8e2ffea412f8d71628a8fbad5a57dc9ee6cd8f2a65dab4
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# ComboData
|
2
2
|
|
3
|
-
|
3
|
+
Analyze a data set for combinations adding to a given value.
|
4
|
+
|
5
|
+
Analyze a data set for pairs with a difference of a given value.
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -17,8 +19,37 @@ Or install it yourself as:
|
|
17
19
|
$ gem install combo_data
|
18
20
|
|
19
21
|
## Usage
|
22
|
+
|
23
|
+
Create a ComboData::DataSet object with an array of values:
|
24
|
+
|
25
|
+
data_set = ComboData::DataSet.new((1..1000).to_a)
|
26
|
+
|
27
|
+
Analyze the data set for combinations adding to a given value.
|
28
|
+
|
29
|
+
data_set.combinations_summing_to 20
|
30
|
+
=> {[1, 19]=>20, [2, 18]=>20, [3, 17]=>20, [4, 16]=>20, [5, 15]=>20, [6, 14]=>20, [7, 13]=>20, [8, 12]=>20, [9, 11]=>20, [20]=>20}
|
31
|
+
|
32
|
+
Change the max combination length:
|
33
|
+
|
34
|
+
data_set.max_combination_length = 3 # defaults to 2
|
35
|
+
=> 3
|
36
|
+
hate.combinations_summing_to 20
|
37
|
+
=> {[1, 2, 17]=>20, [1, 3, 16]=>20, [1, 4, 15]=>20, [1, 5, 14]=>20, [1, 6, 13]=>20, [1, 7, 12]=>20, [1, 8, 11]=>20, [1, 9, 10]=>20, [2, 3, 15]=>20, [2, 4, 14]=>20, [2, 5, 13]=>20, [2, 6, 12]=>20, [2, 7, 11]=>20, [2, 8, 10]=>20, [3, 4, 13]=>20, [3, 5, 12]=>20, [3, 6, 11]=>20, [3, 7, 10]=>20, [3, 8, 9]=>20, [4, 5, 11]=>20, [4, 6, 10]=>20, [4, 7, 9]=>20, [5, 6, 9]=>20, [5, 7, 8]=>20, [1, 19]=>20, [2, 18]=>20, [3, 17]=>20, [4, 16]=>20, [5, 15]=>20, [6, 14]=>20, [7, 13]=>20, [8, 12]=>20, [9, 11]=>20, [20]=>20}
|
38
|
+
|
39
|
+
Analyze the data set for pairs with a difference of a given value.
|
40
|
+
|
41
|
+
data_set.pairs_with_a_difference_of 997
|
42
|
+
=> {[1, 998]=>997, [2, 999]=>997, [3, 1000]=>997}
|
43
|
+
|
44
|
+
Change the timeout for processing:
|
45
|
+
|
46
|
+
data_set.timeout = 120 # seconds, defaults to 60
|
47
|
+
=> 120
|
48
|
+
|
49
|
+
Change the precision while making comparisons:
|
20
50
|
|
21
|
-
|
51
|
+
data_set.precision = 3 # decimal places
|
52
|
+
=> 3
|
22
53
|
|
23
54
|
## Contributing
|
24
55
|
|
data/combo_data.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["ksmith@wspackaging.com"]
|
11
11
|
spec.description = %q{Perform analysis of data sets.}
|
12
12
|
spec.summary = %q{Data Analysis}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/K-Y-L-E/combo_data"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/lib/combo_data/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: combo_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Smith
|
@@ -54,7 +54,7 @@ files:
|
|
54
54
|
- lib/combo_data.rb
|
55
55
|
- lib/combo_data/combo_data.rb
|
56
56
|
- lib/combo_data/version.rb
|
57
|
-
homepage:
|
57
|
+
homepage: https://github.com/K-Y-L-E/combo_data
|
58
58
|
licenses:
|
59
59
|
- MIT
|
60
60
|
metadata: {}
|