MCPcopy Create free account
hub / github.com/Kaggle/docker-python / test_classifier

Method test_classifier

tests/test_xgboost.py:14–25  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12 self.assertGreaterEqual(StrictVersion(xgboost.__version__), StrictVersion("1.2.1"))
13
14 def test_classifier(self):
15 X_train = np.random.random((100, 28))
16 y_train = np.random.randint(10, size=(100, 1))
17 X_test = np.random.random((100, 28))
18 y_test = np.random.randint(10, size=(100, 1))
19
20 xgb1 = XGBClassifier(n_estimators=3, use_label_encoder=False, eval_metric='mlogloss')
21 xgb1.fit(
22 X_train, y_train,
23 eval_set=[(X_train, y_train), (X_test, y_test)],
24 )
25 self.assertIn("validation_0", xgb1.evals_result())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected