Table of Contents
AdventureTurtle
train a personalized machine learning model (using vowpal wabbit) with track events
- track set of items and if they converted or no (for example was clicked on) for specific user context
- download a model
- 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
-
apiKey
String api key generated form https://adventureturtle.com, if not specified, new one will be generated -
server
String server url, e.g.: https://adventureturtle.com or http://localhost:8000,
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