Models

post
Create Model

https://api.akk.io/v1/models
Creates a model and returns all calculated stats about the data //including performance, data stories, and field importance
Request
Response
Request
Body Parameters
force
optional
boolean
Forces a retrain on a given model
api_key
required
string
Your api key, accessible from https://app.akk.io/team-settings
dataset_id
required
string
The ID of the dataset to create a model from
predict_fields
required
array
An array of fields to predict
ignore_fields
required
array
An array of fields to ignore
extra_attention
required
boolean
Biases the model towards rare cases- may reduce accuracy but can be helpful if there are few examples
duration
required
number
The train time, in seconds
Response
200: OK
Example response after creating a model
{
"status": "success",
"model_id": "wNFRCKF4L2WRwl75lyja",
"stats": [
[
{
"field": 0,
"field_name": "Survived",
"field_type": "category",
"class": 0,
"class_name": "0",
"count": 85,
"true positives": 77,
"false positives": 13,
"false negatives": 8,
"precision": 0.8555555555555555,
"recall": 0.9058823529411765,
"f1": 0.88,
"frequency": 0.6343283582089553
},
{
"field": 0,
"field_name": "Survived",
"field_type": "category",
"class": 1,
"class_name": "1",
"count": 49,
"true positives": 36,
"false positives": 8,
"false negatives": 13,
"precision": 0.8181818181818182,
"recall": 0.7346938775510204,
"f1": 0.7741935483870968,
"frequency": 0.3656716417910448
}
]
],
"field_importance": {
"Survived": 4.280271639345301e-07,
"Pclass": 0.12783671915531158,
"Name": 0.08911889791488647,
"Sex": 0.24653153121471405,
"Age": 0.25010690093040466,
"Siblings/Spouses Aboard": 0.09955129772424698,
"Parents/Children Aboard": 0.056563444435596466,
"Fare": 0.1302906721830368
},
"data_story": [
{
"name": "Survived",
"type": "category",
"outcomes": [
{
"outcome": "0",
"causes": [
{
"field": "Age",
"top_value": "80",
"bottom_value": "0.42"
},
{
"field": "Sex",
"top_value": "male",
"bottom_value": "female"
},
{
"field": "Fare",
"top_value": "0",
"bottom_value": "512.3292"
},
{
"field": "Pclass",
"top_value": "3",
"bottom_value": "1"
},
{
"field": "Siblings/Spouses Aboard",
"top_value": "0",
"bottom_value": "1"
}
],
"top_case": 0.9213483146067416,
"avg_case": 0.6144306651634723,
"bottom_case": 0.033707865168539325
},
{
"outcome": "1",
"causes": [
{
"field": "Age",
"top_value": "0.42",
"bottom_value": "80"
},
{
"field": "Sex",
"top_value": "female",
"bottom_value": "male"
},
{
"field": "Fare",
"top_value": "512.3292",
"bottom_value": "0"
},
{
"field": "Pclass",
"top_value": "1",
"bottom_value": "3"
},
{
"field": "Siblings/Spouses Aboard",
"top_value": "1",
"bottom_value": "0"
}
],
"top_case": 0.9662921348314607,
"avg_case": 0.3855693348365276,
"bottom_case": 0.07865168539325842
}
]
}
]
}

post
Make Prediction

https://api.akk.io/v1/models
Makes a
Request
Response
Request
Body Parameters
api_key
required
string
Your api key, accessible from https://app.akk.io/team-settings
data
required
array
Data in the format of: [{'field name 1': 'value 1', 'field name 2': 0}, {...}, ...]
id
required
string
The ID of the model to make the prediction with
Response
200: OK
Example response from request on the titanic dataset: { "id":"wNFRCKF4L2WRwl75lyja", "data": [{"Age":58}], "api_key": "YOUR_API_KEY" }
{
"status": "success",
"predictions": [
{
"Survived": "0",
"Probability Survived is 0": 0.8029362559318542,
"Probability Survived is 1": 0.19706374406814575
}
]
}

get
Get All Models

https://api.akk.io/v1/models
Request
Response
Request
Query Parameters
api_key
required
string
Your api key, accessible from https://app.akk.io/team-settings
Response
200: OK
{
"status": "success",
"models": [
{
"id": "mpcfo01LuKwZKkH8fMwN",
"name": "titanic-sheet-titanic"
},
{
"id": "nPG4VV5MhXwiiuNdgYTU",
"name": "Lead Scoring Demo"
]
}

‚Äč

delete
Delete Model

https://api.akk.io/v1/models
Request
Response
Request
Body Parameters
id
required
string
The ID of the model to be deleted
api_key
required
string
Your api key, accessible from https://app.akk.io/team-settings
Response
200: OK
{
"status": "success"
}