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

Function test_object_importances

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

Source from the content-addressed store, hash-verified

5058
5059
5060def test_object_importances(task_type):
5061 train_pool = Pool(TRAIN_FILE, column_description=CD_FILE)
5062 pool = Pool(TEST_FILE, column_description=CD_FILE)
5063
5064 model = CatBoost({'loss_function': 'RMSE', 'iterations': 10, 'task_type': task_type, 'gpu_ram_part': TEST_GPU_RAM_PART, 'devices': '0'})
5065 model.fit(train_pool)
5066 indices, scores = model.get_object_importance(pool, train_pool, top_size=10)
5067 oimp_path = test_output_path(OIMP_PATH)
5068 np.savetxt(oimp_path, scores)
5069
5070 return local_canonical_file(oimp_path)
5071
5072
5073def test_positive_object_importance_per_object():

Callers

nothing calls this directly

Calls 6

fitMethod · 0.95
get_object_importanceMethod · 0.95
PoolClass · 0.90
CatBoostClass · 0.90
test_output_pathFunction · 0.85
local_canonical_fileFunction · 0.50

Tested by

no test coverage detected