Skip to content

kumagi/http_jubatus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Jubatus

This is thin wrapper of jubatus rpc for http request.

usage

boot server.

$ go run http_jubatus.go

you can create new jubatus process via cURL rpc.

$ curl localhost:3000/classifier \
    -H 'Content-type: application/json' \
    -X POST \
    -d '{
          "name": "sample_classifier",
          "parameter": {
            "converter" : {
                "string_rules" : [
                    { "key" : "*", "type" : "str", "sample_weight" : "bin", "global_weight" : "bin" }
                ],
                "num_rules" : [
                    { "key" : "*", "type" : "num" }
                ]
            },
            "method" : "PA"
          }
        }'

you will get result

ok

For detail of jubatus configuration, you can see documentation of jubatus More examples of jubatus configuration, you can see jubatus repository.

Now, you can access HTTP endpoint /classifier/sample_classifier/<method>.

curl localhost:3000/classifier/sample_classifier/train \
    -H 'Content-type: application/json' \
    -X POST \
    -d '[
        [
            [
                "bar",
                [
                    [],
                    [
                        ["fuga", 1.0]
                    ],
                    []
                ]
            ]
        ]
      ]'

you will get result

{"result": 1}

For details of methods, you can see jubatus documentation. Definition of interface, you can see interface definition in *.idl files in this page

license

MIT License

About

jubatus wrapper of http

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published