Skip to content

Instantly share code, notes, and snippets.

@kumagi
Created May 30, 2014 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumagi/41ae3ac9c9b5ee59a659 to your computer and use it in GitHub Desktop.
Save kumagi/41ae3ac9c9b5ee59a659 to your computer and use it in GitHub Desktop.
anomaly動かした
require 'json'
require 'pp'
require 'jubatus/anomaly/client'
host = "127.0.0.1"
port = 9199
name = "test"
client = Jubatus::Anomaly::Client::Anomaly.new(host, port, name)
pp JSON.parse(File.open("hundred.json").read).map{|datum|
ret = client.add(Jubatus::Common::Datum.new({
"weight"=>datum[0],
"heat"=>datum[1],
"light"=>datum[2]
}))
{id: ret.id, score:ret.score}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment