http_jubatus

command module
v0.0.0-...-3e10e98 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2015 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

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

Documentation

Overview

-*- coding: utf-8-unix -*-

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL