jubaclient
Jubatus CLI client (unofficial)
Quick Start
npm install -g jubaclient
jubaclassifier -p 9190 -f ./config.json -D
echo '[ [ [ "baz", [ [ [ "foo", "bar" ] ] ] ] ] ]' | \
jubaclient classifier train 9190 localhost 10 | jq '.'
Installation
npm install -g jubaclient
Usage
jubaclient service method [-p port] [-h host] [-n name] [-t timeoutSeconds]
service
: sevice name (classifier
, nearest_neighbor
, etc.)method
: service method (get_status
, train
, get_k_center
, etc.)-p port
: port number (default 9190
)-h host
: hostname (default localhost
)-n name
: name of target cluster (default ''
)-t timeoutSeconds
: timeout (default 0
)
Examples
- save(id)
echo '[ "jubaclient_save_1" ]' | jubaclient classifier save
- get_status()
echo '[]' | jubaclient classifier get_status | jq '.'
- get_config()
echo '[]' | jubaclient classifier get_config | jq '.|fromjson'
- classifier#train(data)
jubaclient classifier train <<EOF | jq '.'
[ [ [ "corge", [ [ [ "message", "<p>foo</p>" ] ] ] ] ] ]
[ [ [ "corge", [ [ [ "message", "<p>bar</p>" ] ] ] ] ] ]
[ [ [ "corge", [ [ [ "message", "<p>baz</p>" ] ] ] ] ] ]
[ [ [ "grault", [ [ [ "message", "<p>qux</p>" ] ] ] ] ] ]
[ [ [ "grault", [ [ [ "message", "<p>quux</p>" ] ] ] ] ] ]
EOF
- classifier#classify(data)
jubaclient classifier classify <<EOF | jq '.'
[ [ [ [ [ "message", "<b>quuz</b>" ] ] ] ] ]
EOF
Requires