# vowpal-turtle

> vowpal wabbit --readable_model parser and predictor

Latest version **0.0.9** (published 2018-09-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install vowpal-turtle
pnpm add vowpal-turtle
yarn add vowpal-turtle
bun add vowpal-turtle
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2018-09-22 |
| First published | 2018-09-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | borislav nikolov |
| Maintainers | jackdoe |
| Keywords | machine-learning, vowpal-wabbit |

## Links

- npm: https://www.npmjs.com/package/vowpal-turtle
- Homepage: https://github.com/jackdoe/vowpal-turtlejs
- npm.io page: https://npm.io/package/vowpal-turtle

## Recent versions

- 0.0.9 (latest) — 2018-09-22
- 0.0.8 — 2018-09-22
- 0.0.7 — 2018-09-19
- 0.0.6 — 2018-09-19
- 0.0.5 — 2018-09-19
- 0.0.4 — 2018-09-17
- 0.0.3 — 2018-09-17
- 0.0.2 — 2018-09-15
- 0.0.1 — 2018-09-15

## README

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [readModel][1]
    -   [Parameters][2]
-   [predict][3]
    -   [Parameters][4]
    -   [Examples][5]

## readModel

[index.js:70-117][6]

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][7]** vw --readable_file output
-   `cb` **[Function][8]** callback once the file is loaded, takes the loaded model as only argument

## predict

[index.js:147-160][9]

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][10]** mode loaded from @see readModel
-   `request` **[Object][10]** {.namespaces - array of namespaces, each of which has array of features}

### Examples

```javascript
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][11]** prediction, one prediction per class (depending on oaa, by default 1)

[1]: #readmodel

[2]: #parameters

[3]: #predict

[4]: #parameters-1

[5]: #examples

[6]: https://github.com/jackdoe/turtlejs/blob/b21a0a0d19d42c12062fdf2f8f34744797867470/index.js#L70-L117 "Source code on GitHub"

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function

[9]: https://github.com/jackdoe/turtlejs/blob/b21a0a0d19d42c12062fdf2f8f34744797867470/index.js#L147-L160 "Source code on GitHub"

[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Float32Array

---
_Source: https://npm.io/package/vowpal-turtle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
