Nomnom Pumpernickle Muffins

    jubatus
    TypeScript icon, indicating that this package has built-in type declarations

    0.9.12 • Public • Published

    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

    Install

    npm i jubatus

    DownloadsWeekly Downloads

    2

    Version

    0.9.12

    License

    MIT

    Unpacked Size

    213 kB

    Total Files

    51

    Last publish

    Collaborators

    • naokikimura