Socket
Socket
Sign inDemoInstall

jubatus

Package Overview
Dependencies
19
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jubatus

Jubatus client for Node.js (unofficial)


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

jubatus-node-client

Build Status npm version Codacy Badge Codacy Badge

Jubatus client for Node.js (unofficial)

Usage

See also http://jubat.us/en/api/index.html

Classifier

var jubatus = require("jubatus"),
    classifier = new jubatus.classifier.client.Classifier(9199, "localhost");
Train
var stringValues = [ ["foo", "bar"] ],
    numValues = [ ["quux", 0.1] ],
    datum = [stringValues, numValues],
    label = "baz",
    data = [ [label, datum] ];

classifier.train(data).then(([ result ] ) => {
    console.error(result);
}).catch(error => {
    console.error(error);
});
Classify
var stringValues = [ ["foo", "qux"] ],
    numValues = [ ["quux", 1] ],
    datum = [stringValues, numValues],
    data = [datum];

classifier.classify(data).then(([ result ] ) => {
    result.forEach(estimateResults => {
        var mostLikely = estimateResults
                .map(([ label, score ]) =>({ label, score })
                .reduce((previous, current) => {
                    return previous.score > current.score ? previous : current;
                }, { label: null, score: NaN });
        console.log("estimate = %j", mostLikely);
    });
}).catch(error => {
    console.error(error);
});

Tutorial

see https://github.com/naokikimura/jubatus-tutorial-node

Keywords

FAQs

Last updated on 03 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc