Sha256: b94b15eea33ac73acbf68ca3319335ebe46e894e426c1feadef99fcdba50d05c

Contents?: true

Size: 276 Bytes

Versions: 6

Compression:

Stored size: 276 Bytes

Contents

module Slate
  module Calculation
    class Mean < Base
      name "Average"
      description "Calculates the average of all points in each of the targets."

      protected

      def map(points)
        points.inject(0.0, :+) / points.size.to_f
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slate-1.1.2 lib/slate/calculation/mean.rb
slate-1.1.1 lib/slate/calculation/mean.rb
slate-1.1.0 lib/slate/calculation/mean.rb
slate-1.0.3 lib/slate/calculation/mean.rb
slate-1.0.2 lib/slate/calculation/mean.rb
slate-1.0.1 lib/slate/calculation/mean.rb