Rakefile in anomaly-0.0.3 vs Rakefile in anomaly-0.1.0

- old
+ new

@@ -5,13 +5,21 @@ require "benchmark" require "anomaly" task :benchmark do - data = 1_000_000.times.map{ [rand, rand, rand, rand] } + examples = 1_000_000.times.map{ [rand, rand, rand, 0] } Benchmark.bm do |x| - x.report { Anomaly::Detector.new(data) } + x.report { Anomaly::Detector.new(examples, {:eps => 0.5}) } require "narray" - x.report { Anomaly::Detector.new(data) } + x.report { Anomaly::Detector.new(examples, {:eps => 0.5}) } end +end + +task :random_examples do + examples = 10_000.times.map{ [rand, rand(10), rand(100), 0] } + + 100.times.map{ [rand + 1, rand(10) + 2, rand(100) + 20, 1] } + + ad = Anomaly::Detector.new(examples) + puts ad.eps end