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 +8 -8
- data/README.md +6 -0
- data/lib/quantile/estimator.rb +9 -1
- data/lib/quantile/version.rb +1 -1
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                YTY1OWFhZDFkYjBmZjMyYmZhYmNiMDNlODU4NGE0NDBmYjNmZDA3NA==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                NTk4YjM5MzFkZjc1YzdhMjVhNzczNTYzOTBjMzc1NGFiYjFlYzE4Mg==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                YzA5MzQ3MTJlMTQxOWQyMmQwNThkY2FjY2FlY2U1MjBhOWEzY2UwM2Q2ZDRk
         | 
| 10 | 
            +
                MWUzZGVjNzgxYTUyOGFiZjEzNjc5Zjk4ODhiNjNhZjc3YTY5YTc4N2E4Yjcy
         | 
| 11 | 
            +
                OGJhYjI5YzA4YmFhNmQ4ZDBkZmRjNjVmM2U5NmNmMTNmMjE2OTg=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 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]
         | 
    
        data/lib/quantile/estimator.rb
    CHANGED
    
    | @@ -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 | 
             
                #
         | 
    
        data/lib/quantile/version.rb
    CHANGED
    
    
    
        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. | 
| 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:  | 
| 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. | 
| 46 | 
            +
            rubygems_version: 2.1.11
         | 
| 47 47 | 
             
            signing_key: 
         | 
| 48 48 | 
             
            specification_version: 4
         | 
| 49 49 | 
             
            summary: Streaming Quantile Estimation
         |