(X: Any, y: List[float])
| 117 | np.testing.assert_allclose(categories_sizes, 1) |
| 118 | |
| 119 | def check_predt(X: Any, y: List[float]) -> None: |
| 120 | reg = xgb.XGBRegressor(tree_method="hist", n_estimators=64, device="cuda") |
| 121 | reg.fit(X, y) |
| 122 | predts = reg.predict(X) |
| 123 | booster = reg.get_booster() |
| 124 | feature_types = booster.feature_types |
| 125 | assert feature_types is not None |
| 126 | assert "c" in feature_types |
| 127 | assert len(feature_types) == 1 |
| 128 | inp_predts = booster.inplace_predict(X) |
| 129 | if isinstance(inp_predts, cp.ndarray): |
| 130 | inp_predts = cp.asnumpy(inp_predts) |
| 131 | np.testing.assert_allclose(predts, inp_predts) |
| 132 | |
| 133 | y = [1, 2, 3] |
| 134 | X = pd.DataFrame({"f0": ["a", "b", "c"]}) |
no test coverage detected