Ejemplo n.º 1
0
def test_learn_without_header_eval_with_header(task_type):
    train_path = yatest.common.test_output_path('airlines_without_header')
    with open(data_file('airlines_5K', 'train'), 'r') as with_header_file:
        with open(train_path, 'w') as without_header_file:
            without_header_file.writelines(with_header_file.readlines()[1:])

    model_path = yatest.common.test_output_path('model.bin')

    fit_params = [
        '--loss-function', 'Logloss',
        '-f', train_path,
        '--cd', data_file('airlines_5K', 'cd'),
        '-i', '10',
        '-m', model_path
    ]
    execute_catboost_fit(
        task_type=task_type,
        params=fit_params,
        devices='0'
    )

    cmd_calc = (
        CATBOOST_PATH,
        'calc',
        '--input-path', data_file('airlines_5K', 'test'),
        '--cd', data_file('airlines_5K', 'cd'),
        '-m', model_path,
        '--has-header'
    )
    yatest.common.execute(cmd_calc)
Ejemplo n.º 2
0
def fit_catboost_gpu(params, devices='0', input_data=None, output_data=None):
    execute_catboost_fit(
        task_type='GPU',
        params=params,
        devices=devices,
        input_data=input_data,
        output_data=output_data
    )