(self, tmp_path: Path)
| 196 | |
| 197 | @pytest.mark.skipif(**tm.no_pandas()) |
| 198 | def test_save_binary(self, tmp_path: Path) -> None: |
| 199 | import pandas as pd |
| 200 | |
| 201 | path = tmp_path / "m.dmatrix" |
| 202 | data = pd.DataFrame({"a": [0, 1], "b": [2, 3], "c": [4, 5]}) |
| 203 | m0 = xgb.DMatrix(data.loc[:, ["a", "b"]], data["c"]) |
| 204 | assert m0.feature_names == ["a", "b"] |
| 205 | m0.save_binary(path) |
| 206 | m1 = xgb.DMatrix(path) |
| 207 | assert m0.feature_names == m1.feature_names |
| 208 | assert m0.feature_types == m1.feature_types |
| 209 | |
| 210 | def test_get_info(self): |
| 211 | dtrain, _ = tm.load_agaricus(__file__) |
nothing calls this directly
no test coverage detected