Sha256: 23dd77f43f29656e835fcc6e7f089a9ac46137abc436c7a80d36a03333b90cd5

Contents?: true

Size: 244 Bytes

Versions: 11

Compression:

Stored size: 244 Bytes

Contents

module Disco
  module Metrics
    class << self
      def rmse(act, exp)
        raise ArgumentError, "Size mismatch" if act.size != exp.size
        Math.sqrt(act.zip(exp).sum { |a, e| (a - e)**2 } / act.size.to_f)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
disco-0.5.0 lib/disco/metrics.rb
disco-0.4.2 lib/disco/metrics.rb
disco-0.4.0 lib/disco/metrics.rb
disco-0.3.2 lib/disco/metrics.rb
disco-0.3.1 lib/disco/metrics.rb
disco-0.3.0 lib/disco/metrics.rb
disco-0.2.9 lib/disco/metrics.rb
disco-0.2.8 lib/disco/metrics.rb
disco-0.2.7 lib/disco/metrics.rb
disco-0.2.6 lib/disco/metrics.rb
disco-0.2.5 lib/disco/metrics.rb