Socket
Socket
Sign inDemoInstall

jubatus

Package Overview
Dependencies
16
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
16
increased by1500%
Maintainers
1
Install size
4.00 MB
Created
Weekly downloads
 

Readme

Source

jubatus-node-client

Build Status npm version Codacy Badge Codacy Badge Known Vulnerabilities

Jubatus client for Node.js (unofficial)

Usage

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

Classifier

const jubatus = require("jubatus");

const classifier = new jubatus.classifier.client.Classifier(9199, "localhost");
Train
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);
});
Classify
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);
});

Tutorial

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

Keywords

FAQs

Last updated on 06 Mar 2019

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