Created
December 9, 2013 06:17
-
-
Save katsyoshi/7868145 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'jubatus/anomaly/client' | |
| require './jubatus_data' | |
| keys = ('a'..'t').to_a | |
| data = JubatusData.read_data('./baseball.csv',keys,'b') | |
| jubatus = Jubatus::Anomaly::Client::Anomaly.new('localhost', 9199, '') | |
| r = [] | |
| data.each do |datum| | |
| if ARGV[0] =~ /update/ | |
| p jubatus.overwrite(datum[0], datum[1]) | |
| else | |
| r << {datum[0] => jubatus.calc_score(datum[1])} | |
| end | |
| end | |
| p r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ubuntu-12% jubaanomaly -f /opt/jubatus/share/jubatus/example/config/anomaly/lof.json | |
| I1209 06:16:36.924160 18068 server_util.cpp:287] starting jubaanomaly 0.5.0 RPC server at 172.16.138.135:9199 | |
| pid : 18068 | |
| user : vagrant | |
| mode : standalone mode | |
| timeout : 10 | |
| thread : 2 | |
| datadir : /tmp | |
| logdir : | |
| loglevel : INFO(0) | |
| zookeeper : | |
| name : | |
| join : false | |
| interval sec : 16 | |
| interval count : 512 | |
| zookeeper timeout : 10 | |
| interconnect timeout : 10 | |
| I1209 06:16:36.928140 18068 server_util.cpp:78] load config from local file: /opt/jubatus/share/jubatus/example/config/anomaly/lof.json | |
| I1209 06:16:36.928925 18068 anomaly_serv.cpp:146] config loaded: { | |
| "converter" : { | |
| "string_filter_types" : {}, | |
| "string_filter_rules" : [], | |
| "num_filter_types" : {}, | |
| "num_filter_rules" : [], | |
| "string_types" : {}, | |
| "string_rules" : [ | |
| { "key" : "*", "type" : "str", "sample_weight" : "bin", "global_weight" : "bin" } | |
| ], | |
| "num_types" : {}, | |
| "num_rules" : [ | |
| { "key" : "*", "type" : "num" } | |
| ] | |
| }, | |
| "parameter" : { | |
| "nearest_neighbor_num" : 10, | |
| "reverse_nearest_neighbor_num" : 30, | |
| "method" : "euclid_lsh", | |
| "parameter" : { | |
| "hash_num" : 64, | |
| "table_num" : 4, | |
| "seed" : 1091, | |
| "probe_num" : 64, | |
| "bin_width" : 100, | |
| "retain_projection" : false | |
| } | |
| }, | |
| "method" : "lof" | |
| } | |
| I1209 06:16:36.930258 18068 server_helper.hpp:175] start listening at port 9199 | |
| I1209 06:16:36.930428 18068 server_helper.hpp:181] jubaanomaly RPC server startup | |
| W1209 06:16:44.726718 18070 rpc_server.cpp:46] Dynamic exception type: jubatus::core::common::unsupported_method::what: unsupported method (set_row) | |
| #0 [jubatus::core::common::exception::error_at_file_*] = ../jubatus/core/anomaly/lof.cpp | |
| #0 [jubatus::core::common::exception::error_at_line_*] = 114 | |
| #0 [jubatus::core::common::exception::error_at_func_*] = virtual void jubatus::core::anomaly::lof::set_row(const string&, const sfv_t&) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ubuntu-12% be ruby anomaly.rb update | |
| /home/vagrant/Program/Jubatus/ruby/.bundle/gems/ruby/2.0.0/gems/msgpack-rpc-0.5.1/lib/msgpack/rpc/future.rb:54:in `get': unsupported method (set_row) (MessagePack::RPC::RuntimeError) | |
| from /home/vagrant/Program/Jubatus/ruby/.bundle/gems/ruby/2.0.0/gems/jubatus-0.5.0/lib/jubatus/common/client.rb:26:in `call' | |
| from /home/vagrant/Program/Jubatus/ruby/.bundle/gems/ruby/2.0.0/gems/jubatus-0.5.0/lib/jubatus/anomaly/client.rb:34:in `overwrite' | |
| from anomaly.rb:10:in `block in <main>' | |
| from anomaly.rb:8:in `each' | |
| from anomaly.rb:8:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
overwrite RPCはlight_lofのとき、update/clear_rowRPCはrecommenderベースのアルゴリズムのときにのみ利用できるそうです(beam2dさんより)。twitterでリプライしましたが、こちらでもコメントしておきます。