Sha256: db7ab83f81a0e8ee305b20e9a858d61ba572d38cb76f656ea75bb8351a1d952b

Contents?: true

Size: 427 Bytes

Versions: 8

Compression:

Stored size: 427 Bytes

Contents

require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')

class TestMiscMath < Test::Unit::TestCase
  def test_mean
    assert_equal 4, Misc.mean([6,2])
  end

  def test_softmax
    assert_equal 0.5, Misc.softmax([1,1]).first
    assert Misc.softmax([1,2]).first < 0.5
    assert Misc.softmax([2,1]).first > 0.5
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scout-essentials-1.6.8 test/scout/misc/test_math.rb
scout-essentials-1.6.7 test/scout/misc/test_math.rb
scout-essentials-1.6.6 test/scout/misc/test_math.rb
scout-essentials-1.6.5 test/scout/misc/test_math.rb
scout-essentials-1.6.4 test/scout/misc/test_math.rb
scout-essentials-1.6.3 test/scout/misc/test_math.rb
scout-essentials-1.6.2 test/scout/misc/test_math.rb
scout-essentials-1.6.1 test/scout/misc/test_math.rb