Solve ML problems as a web service
POST /models
=> create a modelGET /models/:id
=> get the statistics on a modelPOST /models/:id/datum
=> send a data pointPOST /models/:id/data
=> send multiple data pointsPOST /models/:id/learn
=> train the modelPOST /models/:id/predict
=> evaluate on a data point
Types of models (all regression):
- "logistic"
- "linear"
- "poisson" (later?)
POST /models
{
"id": "xxx",
"type": "logistic",
"covariates": ["age", "gender", "age-gender"],
"trained": false
}
GET /models/:id
{
"id": "xxx",
"type": "logistic",
"coefficients": {
"age": 2.52,
"gender": 3.112,
"age-gender": -0.91,
},
"training_error": "0.01",
"regularization": "0.0001"
}
DELETE /models/:id
OK (deletes model and all data (?))
POST /models/:id/datum
{
"id": "yyy",
"value": 1,
"covariates": {
"age": 78,
"gender": 1,
"age-gender": 78
}
}
POST /models/:id/data
POST /models/:id/learn
Responds as GET /models/:id
, OR sends 200 and then has the user check
GET /models/:id
POST /models/:id/predict
{
"prediction": 0.23,
"value": 0
}