(task_type, problem_type)
| 1474 | |
| 1475 | @pytest.mark.parametrize('problem_type', ['binclass', 'multiclass', 'regression', 'multiregression']) |
| 1476 | def test_fit_with_texts(task_type, problem_type): |
| 1477 | if (task_type == 'GPU') and (problem_type == 'multiregression'): |
| 1478 | pytest.xfail('Catboost does not support MultiRMSE on GPU yet for categorical features') |
| 1479 | |
| 1480 | params = { |
| 1481 | 'dictionaries': [ |
| 1482 | {'dictionary_id': 'UniGram', 'token_level_type': 'Letter', 'occurrence_lower_bound': '1'}, |
| 1483 | {'dictionary_id': 'BiGram', 'token_level_type': 'Letter', 'occurrence_lower_bound': '1', 'gram_order': '2'}, |
| 1484 | {'dictionary_id': 'Word', 'occurrence_lower_bound': '1'}, |
| 1485 | ], |
| 1486 | 'feature_calcers': ['BoW:top_tokens_count=10'] if 'regression' in problem_type else ['NaiveBayes', 'BoW:top_tokens_count=10'], |
| 1487 | 'iterations': 100, |
| 1488 | 'loss_function': { |
| 1489 | 'binclass': 'Logloss', |
| 1490 | 'multiclass': 'MultiClass', |
| 1491 | 'regression': 'RMSE', |
| 1492 | 'multiregression': 'MultiRMSE' |
| 1493 | }[problem_type], |
| 1494 | 'task_type': task_type, |
| 1495 | 'gpu_ram_part': TEST_GPU_RAM_PART, |
| 1496 | 'devices': '0' |
| 1497 | } |
| 1498 | |
| 1499 | learn = ROTTEN_TOMATOES_TRAIN_FILE |
| 1500 | test = ROTTEN_TOMATOES_TEST_FILE |
| 1501 | cd = ROTTEN_TOMATOES_CD_FILE if problem_type == 'multiclass' else ROTTEN_TOMATOES_CD_BINCLASS_FILE |
| 1502 | |
| 1503 | preds1 = fit_from_df(params, learn, test, cd, problem_type == 'multiregression') |
| 1504 | if problem_type != 'multiregression': |
| 1505 | _, preds2 = fit_from_file(params, learn, test, cd) |
| 1506 | assert np.all(preds1 == preds2) |
| 1507 | |
| 1508 | |
| 1509 | def test_coreml_import_export(task_type): |
nothing calls this directly
no test coverage detected