adventureturtle-client

0.0.10 • Public • Published

Table of Contents

AdventureTurtle

train a personalized machine learning model (using vowpal wabbit) with track events

  1. track set of items and if they converted or no (for example was clicked on) for specific user context
  2. download a model
  3. sort set of items for user context

Create new AdventureTurtle the args include:

apiKey: api key generated form https://adventureturtle.com, if not specified, new one will be generated server: server url, e.g.: https://adventureturtle.com or http://localhost:8000,

Parameters

Examples

var turtle = new AdventureTurtle({apiKey: '1f27db85-befe-47ed-8e08-80d87eefd272'})
turtle.track([{features: ["italian", "pizza"]},{features: ["dutch", "beer"]}],{features: ["from=nl"]},true)
var turtle = new AdventureTurtle({apiKey: '1f27db85-befe-47ed-8e08-80d87eefd272'})
turtle
    .downloadModel()
    .then((hasNewModel) => {
         if (hasNewModel) {
           var sorted = turtle.sort(this.props.items, this.props.user)
           this.setState({sortedList: sorted})
         }
     });
var turtle = new AdventureTurtle('1f27db85-befe-47ed-8e08-80d87eefd272')
turtle
    .downloadModel()
    .then((hasNewModel) => {
        var sorted = turtle.sort([
            {
                features: ["pizza", "beer"]
            }, {
                features: ["dutch","food"]
            }
        ], { features: ["from=nl"]});
        console.log(sorted)
    });

track

track converting or non converting set of items for specific user context like: turtle.track([{features: ["italian", "pizza"]},{features: ["dutch", "beer"]}],{features: "from=nl"})

Parameters

  • items Array array of items
  • userContext Object user context
  • convert Boolean is the action/event converting (click or buy or something you care about)

downloadModel

download and cache the vowpal wabbit model

sort

using the current model, sor the array of items for specific user

Parameters

  • inputList Array list of objects having array of features property [{features:["a","b","c"]}]
  • userFeatures Object object having array of features {features:["a","b","c"]}

Readme

Keywords

none

Package Sidebar

Install

npm i adventureturtle-client

Weekly Downloads

1

Version

0.0.10

License

ISC

Unpacked Size

13.9 kB

Total Files

4

Last publish

Collaborators

  • jackdoe