Skip to content

Train Model

In the previous step, you have saved your data in the database now our solution will generate intelligence from your data. You need to train several models for getting your desired output. In recommender solution, there are three different models which have been designed to serve different purposes. All models are trained on a regular interval if you want to train model manually please go through the following endpoints.

Item model

Item model takes your items from the database and generates intelligence from it so that our solution could recommend items from user behavior and filter out items with personalized search results.

Request endpoint for training item model:

POST /v1/item/train 
Parameter:

name key type value type description
start_date Optional[str] str Initial date of date range based on which you want to train model.
end_date Optional[str] str End date of date range based on which you want to train model.

If you don't pass any value as start date and end date it will train all the data available in item index.

Image model

Image model takes image url from item database and generates feature vectors. Feature vectors leads to calculate the similarity score and predict similar image.

Request endpoint for training image model:

POST /v1/image/train 
Parameter:

name key type value type description
start_date Optional[str] str Initial date of date range based on which you want to train image model.
end_date Optional[str] str End date of date range based on which you want to train image model.

If you don't pass any value as start date and end date it will train all the data available in item index.

Rank model

Rank model considers user behavior, item relations from item data to predict most trending items. You will need user data to train the rank model. Follow user behavior section from tutorial to save user data.

Request endpoint for training rank model:

POST /v1/rank/train 

While hitting the training endpoints, you will get a task id in response. You can check the training status of the model using that task id from GET v1/tasks/{task_id} endpoint.

You could also check the status of any training model with task type form GET/v1/tasks endpoint. By default you will get latest 100 tasks with their details.

Tasks

You can train each model once in 24 hours time frame.