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

Method save_binary

python-package/xgboost/core.py:977–991  ·  view source on GitHub ↗

Save DMatrix to an XGBoost buffer. Saved binary can be later loaded by providing the path to :py:func:`xgboost.DMatrix` as input. Parameters ---------- fname : string or os.PathLike Name of the output buffer file. silent : bool (optional; default

(self, fname: PathLike, silent: bool = True)

Source from the content-addressed store, hash-verified

975 dispatch_meta_backend(self, data, field, "uint32")
976
977 def save_binary(self, fname: PathLike, silent: bool = True) -> None:
978 """Save DMatrix to an XGBoost buffer. Saved binary can be later loaded
979 by providing the path to :py:func:`xgboost.DMatrix` as input.
980
981 Parameters
982 ----------
983 fname : string or os.PathLike
984 Name of the output buffer file.
985 silent : bool (optional; default: True)
986 If set, the output is suppressed.
987 """
988 fname = os.fspath(os.path.expanduser(fname))
989 _check_call(
990 _LIB.XGDMatrixSaveBinary(self.handle, c_str(fname), ctypes.c_int(silent))
991 )
992
993 def set_label(self, label: ArrayLike) -> None:
994 """Set label of dmatrix

Callers 9

test_save_binaryMethod · 0.95
save_dmatrixMethod · 0.95
checkFunction · 0.80
test_basicMethod · 0.80
test_multiclassMethod · 0.80
test_dartMethod · 0.80

Calls 3

_check_callFunction · 0.85
c_strFunction · 0.85
XGDMatrixSaveBinaryMethod · 0.80

Tested by 7

test_save_binaryMethod · 0.76
save_dmatrixMethod · 0.76
test_basicMethod · 0.64
test_multiclassMethod · 0.64
test_dartMethod · 0.64