vowpal-turtle
v0.0.9
Published
vowpal wabbit --readable_model parser and predictor
Downloads
6
Maintainers
Readme
Table of Contents
readModel
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 outputcb
Function callback once the file is loaded, takes the loaded model as only argument
predict
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 readModelrequest
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)