Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (20 sloc) 0.627 kb
#!/usr/bin/env rake
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new("spec")
require "benchmark"
require "anomaly"
task :benchmark do
examples = 1_000_000.times.map{ [rand, rand, rand, 0] }
Benchmark.bm do |x|
x.report { Anomaly::Detector.new(examples, {:eps => 0.5}) }
require "narray"
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
Jump to Line
Something went wrong with that request. Please try again.