[catboost] copy test with quantized pool from gpu tests; catboost currently segfaults on this test (or fails on assert in debug build) to be fixed within couple revision
@@ -10,7 +10,7 @@ import timeit
import json
import catboost
-from catboost_pytest_lib import data_file, local_canonical_file, remove_time_from_json
+from catboost_pytest_lib import data_file, local_canonical_file, remove_time_from_json, apply_catboost
CATBOOST_PATH = yatest.common.binary_path("catboost/app/catboost")
@@ -5509,3 +5509,36 @@ def test_convert_model_to_json(pool):
yatest.common.execute(calc_cmd)
assert (compare_evals_with_precision(output_eval_path, formula_predict_path))
return [local_canonical_file(output_eval_path)]
+
+
+LOSS_FUNCTIONS_NO_MAPE = ['RMSE', 'Logloss', 'MAE', 'CrossEntropy', 'Quantile', 'LogLinQuantile', 'Poisson']
+
+
+@pytest.mark.parametrize('loss_function', LOSS_FUNCTIONS_NO_MAPE)
+@pytest.mark.parametrize('boosting_type', BOOSTING_TYPE)
+def test_quantized_pool(loss_function, boosting_type):
+ output_model_path = yatest.common.test_output_path('model.bin')
+ output_eval_path = yatest.common.test_output_path('test.eval')
+
+ quantized_train_file = 'quantized://' + data_file('quantized_adult', 'train.qbin')
+ quantized_test_file = 'quantized://' + data_file('quantized_adult', 'test.qbin')
+ cmd = (
+ CATBOOST_PATH, 'fit',
+ '--use-best-model', 'false',
+ '--loss-function', loss_function,
+ '-f', quantized_train_file,
+ '-t', quantized_test_file,
+ '--boosting-type', boosting_type,
+ '-i', '10',
+ '-w', '0.03',
+ '-T', '4',
+ '-r', '0',
+ '-m', output_model_path,
+ )
+
+ yatest.common.execute(cmd)
+ cd_file = data_file('quantized_adult', 'pool.cd')
+ test_file = data_file('quantized_adult', 'test_small.tsv')
+ apply_catboost(output_model_path, test_file, cd_file, output_eval_path)
+
+ return [local_canonical_file(output_eval_path)]
