recsys_metrics_polars.data_info#

Classes

DataInfo(query_id_cols, item_col, score_col)

Information about data structure

class recsys_metrics_polars.data_info.DataInfo(query_id_cols, item_col, score_col)[source]#

Bases: object

Information about data structure

For example:

User interactions#

user_id

item_id

score

0

1

0.01

0

5

10

1

1

0.2

2

9

7.96

DataInfo.query_id_cols is equal to "user_id"

DataInfo.item_col is equal to "item_id"

DataInfo.score_col is equal to "score"

In the example:

User interactions per session#

user_id

item_id

session_id

score

0

10

1

0.01

0

10

5

10

1

20

1

0.2

2

90

9

7.96

DataInfo.query_id_cols is equal to ["user_id", "session_id"]

Parameters:
query_id_cols: Union[str, List[str]]#

Single or group of columns which unique identifier query

item_col: str#

Name of column with items

score_col: str#

Name of columns with item scores per query. For any pair of items, an item with higher score is more relevant.