MCPcopy Create free account
hub / github.com/dmlc/xgboost / test_pickling

Method test_pickling

tests/python-gpu/test_gpu_pickling.py:71–87  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

69 # TODO: This test is too slow
70 @pytest.mark.skipif(**tm.no_sklearn())
71 def test_pickling(self) -> None:
72 x, y = build_dataset()
73 train_x = xgb.DMatrix(x, label=y)
74
75 param = {"tree_method": "hist", "device": "cuda"}
76 bst = xgb.train(param, train_x)
77 self.run_pickling(bst)
78
79 bst = xgb.XGBRegressor(**param).fit(x, y)
80 self.run_pickling(bst)
81
82 param = {"booster": "gblinear", "updater": "coord_descent", "device": "cuda"}
83 bst = xgb.train(param, train_x)
84 self.run_pickling(bst)
85
86 bst = xgb.XGBRegressor(**param).fit(x, y)
87 self.run_pickling(bst)
88
89 @pytest.mark.mgpu
90 def test_wrap_gpu_id(self) -> None:

Callers

nothing calls this directly

Calls 5

run_picklingMethod · 0.95
build_datasetFunction · 0.85
DMatrixMethod · 0.45
trainMethod · 0.45
fitMethod · 0.45

Tested by

no test coverage detected