Links
Comment on page

Ranking

Ranking models are often used in recommendation systems, ads, search engines, etc. In Aporia, these models are represented with the ranking model type.

Integration

If you have a ranking or recommendations model, then your database may look like the following:
id
feature1 (numeric)
feature2 (boolean)
scores (array)
relevance (array)
timestamp (datetime)
1
13.5
True
[9, 8, 10, ...]
[2, 0, 1, ...]
2014-10-19 10:23:54
2
-8
False
[4.5, 8.7, 9, ...]
[0, 1, 2, ...]
2014-10-19 10:24:24
To monitor a ranking model, create a new model version with an array field(s):
apr_model = aporia.create_model_version(
model_id="<MODEL_ID>", # You will need to create a model with this MODEL_ID in advance
model_version="v1",
model_type="ranking"
features={
...
},
predictions={
"scores": "array"
},
)
To connect your data source to this model in Aporia, please call the connect_serving(...) API:
apr_model.connect_serving(
data_source=my_data_source,
​
id_column="id",
timestamp_column="timestamp",
​
predictions={
# Prediction name -> Column name representing
"relevance": "scores"
}
)
Check out the Data Sources section for further reading on the available data sources and how to connect to each one of them.