Jubatus client for Node.js (unofficial)
See also http://jubat.us/en/api/index.html
const jubatus = require("jubatus");
const classifier = new jubatus.classifier.client.Classifier(9199, "localhost");
const datum = new jubatus.common.types.Datum().addString("foo", "bar").addNumber("quux", 0.1);
const labeledDatum = new jubatus.classifier.types.LabeledDatum("baz", datum);
const data = [labeledDatum];
classifier.train(data).then(result => {
console.error(result);
}).catch(error => {
console.error(error);
});
var stringValues = [ [ "foo", "qux" ] ],
numValues = [ [ "quux", 1 ] ],
datum = new jubatus.common.types.Datum(stringValues, numValues),
data = [ datum ];
classifier.classify(data).then(result => {
result.forEach(estimateResults => {
var mostLikely = estimateResults
.reduce((previous, current) => previous.score > current.score ? previous : current);
console.log("estimate = %j", mostLikely);
});
}).catch(error => {
console.error(error);
});
see https://github.com/naokikimura/jubatus-tutorial-node