(features_dtype, task_type)
| 2236 | ids=['features_dtype=str', 'features_dtype=np.float32'] |
| 2237 | ) |
| 2238 | def test_querywise(features_dtype, task_type): |
| 2239 | train_pool = Pool(QUERYWISE_TRAIN_FILE, column_description=QUERYWISE_CD_FILE) |
| 2240 | test_pool = Pool(QUERYWISE_TEST_FILE, column_description=QUERYWISE_CD_FILE) |
| 2241 | model = CatBoostRanker(loss_function='QueryRMSE', iterations=2, thread_count=8, task_type=task_type, gpu_ram_part=TEST_GPU_RAM_PART, devices='0') |
| 2242 | model.fit(train_pool) |
| 2243 | pred1 = model.predict(test_pool) |
| 2244 | |
| 2245 | df = pd.read_csv(QUERYWISE_TRAIN_FILE, delimiter='\t', header=None) |
| 2246 | train_query_id = df.loc[:, 1] |
| 2247 | train_target = df.loc[:, 2] |
| 2248 | train_data = df.drop([0, 1, 2, 3, 4], axis=1).astype(eval(features_dtype)) |
| 2249 | |
| 2250 | df = pd.read_csv(QUERYWISE_TEST_FILE, delimiter='\t', header=None) |
| 2251 | test_data = df.drop([0, 1, 2, 3, 4], axis=1).astype(eval(features_dtype)) |
| 2252 | |
| 2253 | model.fit(train_data, train_target, group_id=train_query_id) |
| 2254 | pred2 = model.predict(test_data) |
| 2255 | assert _check_data(pred1, pred2) |
| 2256 | |
| 2257 | |
| 2258 | def test_group_weight(task_type): |
nothing calls this directly
no test coverage detected