Training
Last updated
Was this helpful?
Last updated
Was this helpful?
Our training endpoints allow you to programmatically train models based off of datasets you've uploaded to Akkio. They can be viewed as a better-designed v2 of our legacy /v1/models
route.
Training is a fundamentally long operation, so is surfaced through a polling-based mechanism where you make the following calls:
One call to /new
to submit the task
Polling calls to /{task_id}/status
to check up on your task's status
One last call to /{task_id}/result
once /status
indicates it's done
Here's a rough outline of how you'd make a request to the Inference bulk predictions endpoints.
X-API-Key
Yes
First, we'll submit the task into our asynchronous processing queue.
POST /api/v1/models/train/new
You'll receive an object like this containing a task id:
We'll use this in the next request.
Next, we'll query the status endpoint at a cadence to see whether the task is complete yet. This request might look something like this:
GET /api/v1/models/train/<task_id>/status
Note that you must use the same Task ID that you received from the task creation endpoint above.
Here's an example response you might get:
You should retry ("poll") this endpoint at a regular cadence until you get a response that looks something like this:
note
The location
field is always relative to the API root (https://api.akkio.com/api/v1
), not the overall website root (https://api.akkio.com
). You'll need to remember to construct the end URL from the site name, API root, and the provided location.
Armed with this information, we'll move to the last request.
Armed with the location we got from the status call, we'll make a request for the end result.
GET /api/v1/models/train/<task_id>/result
You'll get a response that looks something like this:
Your team's API key. See .
This will provide you with a status
field set to either SUBMITTED
, IN_PROGRESS
, FAILED
, or SUCCEEDED
. You can read more about each state on the page.
Model creation via API.
The ID of the dataset to train the model on.
Integer corresponding to how much time we should spend on training. Higher values will take longer but generally be more accurate. Allowed values: 10 (Fastest), 60 (High Quality), 300 (Higher Quality), 1800 (Production)
Helps with predicting rare cases.
false
Forces the creation of a new model even if another currently exists.
false
An array of field names to ignore (case sensitive).
[]
An array of field names to predict (case sensitive).