jubaclient
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "jubaclient", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Jubatus CLI client (unofficial)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,9 +17,13 @@ # jubaclient | ||
# startup jubaclassifier | ||
jubaclassifier -p 9190 -f ./config.json -D | ||
jubaclassifier -f ./config.json -D | ||
# classifier#train() | ||
echo '[ [ [ "baz", [ [ [ "foo", "bar" ] ] ] ] ] ]' | \ | ||
jubaclient classifier train 9190 localhost 10 | jq '.' | ||
jubaclient classifier train | jq '.' | ||
``` | ||
## Requires ## | ||
- [Node.js](https://nodejs.or]) v6+ | ||
## Installation ## | ||
@@ -35,3 +39,6 @@ | ||
The `jubaclient` command requests JSON received from standard input with the specified method to the Jubatus server, and returns the response to the standard output. | ||
The command line options are as follows: | ||
- <code>_service_</code>: sevice name (`classifier`, `nearest_neighbor`, etc.) | ||
@@ -46,11 +53,11 @@ - <code>_method_</code>: service method (`get_status`, `train`, `get_k_center`, etc.) | ||
- save(id) | ||
- #save(id) | ||
```bash | ||
echo '[ "jubaclient_save_1" ]' | jubaclient classifier save | ||
``` | ||
- get_status() | ||
- #get_status() | ||
```bash | ||
echo '[]' | jubaclient classifier get_status | jq '.' | ||
``` | ||
- get_config() | ||
- #get_config() | ||
```bash | ||
@@ -75,5 +82,64 @@ echo '[]' | jubaclient classifier get_config | jq '.|fromjson' | ||
``` | ||
## Tutorial ## | ||
## Requires ## | ||
### Classifier #### | ||
- [Node.js](https://nodejs.or]) v6+ | ||
See also http://jubat.us/en/tutorial/classifier.html | ||
1. start `jubaclassifier` process. | ||
```bash | ||
jubaclassifier -D --configpath gender.json | ||
``` | ||
2. train | ||
```bash | ||
cat train.csv \ | ||
| jq -RcM 'split(",")|[[[.[0],[[["hair",.[1]],["top",.[2]],["bottom",.[3]]],[["height",(.[4]|tonumber)]]]]]]' \ | ||
| jubaclient classifier train | ||
``` | ||
3. classify | ||
```bash | ||
cat classify.csv \ | ||
| jq -RcM 'split(",")|[[[[["hair",.[0]],["top",.[1]],["bottom",.[2]]],[["height",(.[3]|tonumber)]]]]]' \ | ||
| jubaclient classifier classify \ | ||
| jq '.[]|max_by(.[1])' | ||
``` | ||
configure: `gender.json` | ||
```json | ||
{ | ||
"method": "AROW", | ||
"converter": { | ||
"num_filter_types": {}, "num_filter_rules": [], | ||
"string_filter_types": {}, "string_filter_rules": [], | ||
"num_types": {}, "num_rules": [], | ||
"string_types": { | ||
"unigram": { "method": "ngram", "char_num": "1" } | ||
}, | ||
"string_rules": [ | ||
{ "key": "*", "type": "unigram", "sample_weight": "bin", "global_weight": "bin" } | ||
] | ||
}, | ||
"parameter": { "regularization_weight" : 1.0 } | ||
} | ||
``` | ||
training data: `train.csv` | ||
```csv | ||
male,short,sweater,jeans,1.70 | ||
female,long,shirt,skirt,1.56 | ||
male,short,jacket,chino,1.65 | ||
female,short,T shirt,jeans,1.72 | ||
male,long,T shirt,jeans,1.82 | ||
female,long,jacket,skirt,1.43 | ||
``` | ||
test data: `classify.csv` | ||
```csv | ||
short,T shirt,jeans,1.81 | ||
long,shirt,skirt,1.50 | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13181
142