Skip to content

Training

After you have integrated and saved your data in the GAIP database, you can train and generate intelligence from your data. You need to train several models to get your desired output. In GAIP, there are three different models that have been designed to serve different purposes.

All models are trained at regular intervals. You can also train them models manually using the following endpoints.

Note that It is recommended to run all the trainings once manually after importing the item catalog/data into GAIP. After that you can check the result immediately

Item Training

This endpoint trains item data and generates intelligence from it. Item data are trained automatically on a regular time interval. This endpoint can be used to train item data manually.

Request endpoint for training item model:

GET /v1/items/train 

You will see few parameters for this endpoints.

  • train_all: Here you can select true or false. true will train all items in your item catalog. If you have a lot of items, this will use lot of resources so it is recommended to not use it unless necessary. If you select false, this will only train new or updated items.
  • train_from: Here you can define a data. Only items added after this date will be trained.
  • train_to: Here you can define a data. Only items added before this date will be trained.

Image Training

The image model uses an images pointed by the image URL from the item catalog to create feature vectors. These vectors are then used to calculate a similarity score and find similar images.

Request endpoint for training image model:

GET /v1/images/train 

Note that you can use this only if you have added image URLs in your item catalog.

Similar to items/train, this endpoints also takes a take range in the request body as below. Training all images can be very resource intensive, thus it is recommended to narrow down the range if possible.

{
  "start_date": "2021-08-05",
  "end_date": "2021-08-06"
}

Rank Training

Rank model considers user behavior, item relations from item data to predict most trending items.

Note that you will need user data to train the rank model properly. Without any user behavior data, this model cannot be trained.

Request endpoint for training rank model:

GET /v1/ranks/train 

All training jobs are background tasks and might take some time. When hitting any of the the training endpoints, you will get a task_id in response. You can check the training status using that task_id from GET v1/tasks/{task_id} endpoint. It is recommended to always check and confirm if the training was successful.