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

Function test_prediction_plot

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

Source from the content-addressed store, hash-verified

8013
8014
8015def test_prediction_plot():
8016 preds_path = test_output_path('predictions.json')
8017 n_features = 3
8018 n_samples = 500
8019 np.random.seed(42)
8020 X = np.random.rand(n_samples, n_features)
8021 y = np.random.rand(n_samples)
8022 model = CatBoostRegressor(iterations=200)
8023 model.fit(X, y, silent=True)
8024
8025 res, _ = model.plot_predictions(data=X[:2, ], features_to_change=[0, 1], plot=False)
8026 json.dump(res, open(preds_path, 'w'))
8027 return local_canonical_file(preds_path)
8028
8029
8030def test_binclass_with_nontrivial_classes():

Callers

nothing calls this directly

Calls 8

fitMethod · 0.95
CatBoostRegressorClass · 0.90
test_output_pathFunction · 0.85
plot_predictionsMethod · 0.80
openFunction · 0.50
local_canonical_fileFunction · 0.50
seedMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected