Module: Disco::Metrics
- Defined in:
- lib/disco/metrics.rb
Class Method Summary collapse
Class Method Details
.rmse(act, exp) ⇒ Object
4 5 6 7 |
# File 'lib/disco/metrics.rb', line 4 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 |