[TRANSLATION ERROR] There are no messages for this key

Tutorial 3: Training

Quickstart Guide

In order to make accurate recommendations, the model needs to be trained. Training can be performed on-demand, at any time. At the moment, it is possible to train a model for the following engines: hybrid and content_based.

Note: For the correct model to be generated, the engine must match the one selected for recommendations when Creating a Table. Additional training may be performed for different engines, but they will have no effect on each others' recommendations.

Register a Training Order

In order to make recommendation using the content_based engine, we will train the model for the dataset we loaded in Tutorial 2:

POST /v2/recomm/projects/train HTTP/1.1

{
    "engine": "content_based"
}

The JSON returned in the response to this command includes two fields: requestId and status. The former is the needed to check the order status, which is indicated by the latter:

HTTP/1.1 202 Accepted
Content-Type: application/json
{
    "requestId": "ddbb736a-d6c2-4f3d-8716-d5c827d2bb54",
    "status": "queued"
}

Check Training Status

The work orders are processed on-demand, but if those commands are run immediately after posting the orders, the response will be the same as above:

GET /v2/recomm/projects/train/ddbb736a-d6c2-4f3d-8716-d5c827d2bb54 HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
    "requestId": "ddbb736a-d6c2-4f3d-8716-d5c827d2bb54",
    "status": "queued"
}

When the system starts training the model, the status will change to processing:

GET /v2/recomm/projects/train/ddbb736a-d6c2-4f3d-8716-d5c827d2bb54 HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
    "requestId": "ddbb736a-d6c2-4f3d-8716-d5c827d2bb54",
    "status": "processing"
}

Depending on the dataset size, the process can last anywhere from minutes to hours.

Verify Completed Training

After the training finishes, if no fatal error has occurred, there are two possible statuses: completed and completed with errors. The former asserts that all the elements were trained correctly, whereas the latter is returned when some of them could not be trained correctly.

GET /v2/recomm/projects/train/ddbb736a-d6c2-4f3d-8716-d5c827d2bb54 HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
    "requestId": "ddbb736a-d6c2-4f3d-8716-d5c827d2bb54",
    "status": "completed"
}