Bhaskar
Bhaskar

Reputation: 343

Error while creating Catboost Pools for Ranking Model

I am trying to build a ranking model using Catboost library. I am getting the below error while creating a Pool on my training set.

CatBoostError: catboost/private/libs/data_types/query.cpp:25: Error: queryIds should be grouped

The columns which I am using to group the rows is an array of strings column. In the examples which I have seen in, they are mostly an array of integers. Did anyone faced a similar issue before?

Upvotes: 2

Views: 1201

Answers (1)

sdk
sdk

Reputation: 307

I had same issue while using below code

train_data = Pool(
            data=input_data[['input_col']],
            label=input_data[['score']],
            group_id=input_data[['query_id']],
            text_features=text_features
)

It got resolved after sorting input_data with query_id

Upvotes: 4

Related Questions