watex.utils.mlutils.dumpOrSerializeData#

watex.utils.mlutils.dumpOrSerializeData(data, filename=None, savepath=None, to=None, verbose=0)[source]#

Dump and save binary file

Parameters
  • data – Object Object to dump into a binary file.

  • filename – str Name of file to serialize. If ‘None’, should create automatically.

  • savepath – str, PathLike object Directory to save file. If not exists should automaticallycreate.

  • to – str Force your data to be written with specific module like joblib or Python pickle` module. Should be ``joblib or pypickle.

Returns

str dumped or serialized filename.

Example
>>> import numpy as np
>>> from watex.utils.mlutils import dumpOrSerializeData
>>>  data=(np.array([0, 1, 3]),np.array([0.2, 4]))
>>> dumpOrSerializeData(data, filename ='__XTyT.pkl', to='pickle',
                        savepath='watex/datasets')