0.0.10 • Published 6 years ago

adventureturtle-client v0.0.10

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

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

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago