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

Function test_multiregression

catboost/python-package/ut/medium/test.py:376–392  ·  view source on GitHub ↗
(niter, n=10)

Source from the content-addressed store, hash-verified

374
375@pytest.mark.parametrize('niter', [100, 500])
376def test_multiregression(niter, n=10):
377 xs = np.arange(n).reshape((-1, 1)).astype(np.float32)
378 ys = np.hstack([
379 (xs > 0.5 * n),
380 (xs < 0.5 * n)
381 ]).astype(np.float32)
382
383 model = CatBoostRegressor(loss_function='MultiRMSE', iterations=niter)
384 model.fit(xs, ys)
385 ys_pred = model.predict(xs)
386 model.score(xs, ys)
387
388 preds_path = test_output_path(PREDS_TXT_PATH)
389 np.savetxt(preds_path, np.array(ys_pred), fmt='%.8f')
390
391 assert ys_pred.shape == ys.shape
392 return local_canonical_file(preds_path)
393
394
395@pytest.mark.parametrize('niter', [1, 100, 500])

Callers

nothing calls this directly

Calls 8

fitMethod · 0.95
predictMethod · 0.95
scoreMethod · 0.95
CatBoostRegressorClass · 0.90
test_output_pathFunction · 0.85
reshapeMethod · 0.80
local_canonical_fileFunction · 0.50
arrayMethod · 0.45

Tested by

no test coverage detected