MCPcopy Create free account
hub / github.com/catboost/catboost / test_multi_reload_model

Function test_multi_reload_model

catboost/python-package/ut/medium/test.py:3204–3234  ·  view source on GitHub ↗
(task_type)

Source from the content-addressed store, hash-verified

3202
3203
3204def test_multi_reload_model(task_type):
3205 friday_train_pool = Pool(data=BLACK_FRIDAY_TRAIN_FILE, column_description=BLACK_FRIDAY_CD_FILE, has_header=True)
3206 friday_params = dict(
3207 iterations=20,
3208 learning_rate=0.5,
3209 task_type=task_type,
3210 gpu_ram_part=TEST_GPU_RAM_PART,
3211 devices='0',
3212 max_ctr_complexity=1,
3213 target_border=5000,
3214 )
3215 friday_model = CatBoostClassifier(**friday_params)
3216 friday_model.fit(friday_train_pool)
3217 friday_model_path = test_output_path('friday_' + OUTPUT_MODEL_PATH)
3218 friday_model.save_model(friday_model_path)
3219
3220 adult_train_pool = Pool(TRAIN_FILE, column_description=CD_FILE)
3221 adult_model = CatBoost({'iterations': 2, 'loss_function': 'RMSE', 'task_type': task_type, 'gpu_ram_part': TEST_GPU_RAM_PART, 'devices': '0'})
3222 adult_model.fit(adult_train_pool)
3223 adult_model_path = test_output_path('adult_' + OUTPUT_MODEL_PATH)
3224 adult_model.save_model(adult_model_path)
3225
3226 model = CatBoost()
3227 model.load_model(friday_model_path)
3228 model.predict(friday_train_pool)
3229 model.load_model(adult_model_path)
3230 model.predict(adult_train_pool)
3231 model.load_model(friday_model_path)
3232 model.predict(friday_train_pool)
3233 model.load_model(adult_model_path)
3234 model.predict(adult_train_pool)
3235
3236
3237def test_ignored_features_names(task_type):

Callers

nothing calls this directly

Calls 10

fitMethod · 0.95
save_modelMethod · 0.95
fitMethod · 0.95
load_modelMethod · 0.95
predictMethod · 0.95
PoolClass · 0.90
CatBoostClassifierClass · 0.90
CatBoostClass · 0.90
dictClass · 0.85
test_output_pathFunction · 0.85

Tested by

no test coverage detected