quantile 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWFlNTllNmI5OWJlNGJiMGQzZDUxZTUzMDg2ZWRhMTI0YWFhNWIwZA==
4
+ YTY1OWFhZDFkYjBmZjMyYmZhYmNiMDNlODU4NGE0NDBmYjNmZDA3NA==
5
5
  data.tar.gz: !binary |-
6
- ZjZkNjZlNjY3NGUxMGEyMGM2ZjU2NTM0ZTFmZDkyOTU4M2RmODZkZg==
6
+ NTk4YjM5MzFkZjc1YzdhMjVhNzczNTYzOTBjMzc1NGFiYjFlYzE4Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmRhYmI1Njg3NDM0ZDg5MGMzZmMyYjM0ZGUyOTU0YzY1OTFmN2YwNGNlZTZh
10
- ZGViMjkzY2ViMzIwNGI4YTY3YTY0NTZlNjcyZjI1NjA4NGNmMWNiZmM1YmVh
11
- NDkxOTAzYjE3NmFkMjhlZjcxYzQwMWM0YTNjNjFjMmI3MzNmMzM=
9
+ YzA5MzQ3MTJlMTQxOWQyMmQwNThkY2FjY2FlY2U1MjBhOWEzY2UwM2Q2ZDRk
10
+ MWUzZGVjNzgxYTUyOGFiZjEzNjc5Zjk4ODhiNjNhZjc3YTY5YTc4N2E4Yjcy
11
+ OGJhYjI5YzA4YmFhNmQ4ZDBkZmRjNjVmM2U5NmNmMTNmMjE2OTg=
12
12
  data.tar.gz: !binary |-
13
- MWMyNDBiMDM3OTUzNTE4Yzg3MjAzOThlZmY5N2ZmZmVmODIwODJiMmU1MDcw
14
- ODY5NjFmYjUyNmY5YTNhNWY2ZmY1NDAwZWNkMmUyZjA0ODZhOWNkYmZhZDJj
15
- MWQ4ZmU1NDBiMDFmOTZjMWU2OWNhMWY5ZThkMWYyOTkzNGI5MmQ=
13
+ ODRhYWY2YTUyYjRhNjc5MjA4ODQzZTViODk0OTBiZjJiMzk4NmY2NGZmNmZm
14
+ MzZmNjNiODU3N2YzZDVhNTFmM2RkMTU0ZjQ1MjAxMjFmYTAxOTY1MjgwYjg5
15
+ YTgwMTU1OWJjODQ0NTg3MTllYzk3NTAwYTg2ZDQ0ZjNhYjEzODg=
data/README.md CHANGED
@@ -23,6 +23,12 @@ end
23
23
 
24
24
  # Retrieve the value of a given quantile
25
25
  estimator.query(0.5)
26
+
27
+ # Retrieve the number of observations
28
+ estimator.observations
29
+
30
+ # Get the sum of all observed values.
31
+ estimator.sum
26
32
  ```
27
33
 
28
34
  ## Tests [![Build Status][2]][3]
@@ -40,7 +40,7 @@ module Quantile
40
40
  @buffer = []
41
41
  @head = nil
42
42
 
43
- @observations = 0
43
+ @observations, @sum = 0, 0
44
44
  end
45
45
 
46
46
  #
@@ -67,6 +67,14 @@ module Quantile
67
67
  flush
68
68
  end
69
69
  @observations += 1
70
+ @sum += value
71
+ end
72
+
73
+ #
74
+ # Returns the sum of all observed values.
75
+ #
76
+ def sum
77
+ @sum
70
78
  end
71
79
 
72
80
  #
@@ -12,5 +12,5 @@
12
12
  # limitations under the License.
13
13
 
14
14
  module Quantile
15
- VERSION = '0.1.0'
15
+ VERSION = '0.2.0'
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quantile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt T. Proud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-22 00:00:00.000000000 Z
11
+ date: 2014-05-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Graham Cormode and S. Muthukrishnan's Effective Computation of Biased
14
14
  Quantiles over Data Streams in ICDE’05
@@ -18,8 +18,8 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - lib/quantile.rb
21
- - lib/quantile/quantile.rb
22
21
  - lib/quantile/estimator.rb
22
+ - lib/quantile/quantile.rb
23
23
  - lib/quantile/version.rb
24
24
  - README.md
25
25
  - LICENSE
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  version: '0'
44
44
  requirements: []
45
45
  rubyforge_project:
46
- rubygems_version: 2.1.2
46
+ rubygems_version: 2.1.11
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: Streaming Quantile Estimation