vowpal-turtle

0.0.9 • Public • Published

Table of Contents

readModel

index.js:70-117

it does not support quadratic/cubic interractions, ngrams/skips, linking functions rather than identity it basically only supports(for now) cat data | vw --readable_model out.txt [-oaa]

Parameters

  • file String vw --readable_file output
  • cb Function callback once the file is loaded, takes the loaded model as only argument

predict

index.js:147-160

makes a prediction from a request and a model the request is { namespaces: [{name: 'some_namespace', features: [{name: 'some_feature', value: 1}]}]}

Parameters

  • model Object mode loaded from @see readModel
  • request Object {.namespaces - array of namespaces, each of which has array of features}

Examples

var vw = require('vowpal-turtle')
vw.readModel('readable_model.txt', (model) => {
    var prediction = vw.predict(model, {
        namespaces: [{
            name: 'something',
            features: [{
                name: 'a',
                value: 1
            }, {
                name: 'b',
                value: 1
            }, {
                name: 'c',
                value: 1
            }]
        }]
    });
    console.log(prediction)
});

Returns Float32Array prediction, one prediction per class (depending on oaa, by default 1)

Dependents (1)

Package Sidebar

Install

npm i vowpal-turtle

Weekly Downloads

0

Version

0.0.9

License

ISC

Unpacked Size

13.3 kB

Total Files

7

Last publish

Collaborators

  • jackdoe