skopt.utils
.dump¶
- skopt.utils.dump(res, filename, store_objective=True, **kwargs)[source][source]¶
Store an skopt optimization result into a file.
- Parameters
- res
OptimizeResult
, scipy object Optimization result object to be stored.
- filenamestring or
pathlib.Path
The path of the file in which it is to be stored. The compression method corresponding to one of the supported filename extensions (‘.z’, ‘.gz’, ‘.bz2’, ‘.xz’ or ‘.lzma’) will be used automatically.
- store_objectiveboolean, default=True
Whether the objective function should be stored. Set
store_objective
toFalse
if your objective function (.specs['args']['func']
) is unserializable (i.e. if an exception is raised when trying to serialize the optimization result).Notice that if
store_objective
is set toFalse
, a deep copy of the optimization result is created, potentially leading to performance problems ifres
is very large. If the objective function is not critical, one can delete it before callingskopt.dump()
and thus avoid deep copying ofres
.- **kwargsother keyword arguments
All other keyword arguments will be passed to
joblib.dump
.
- res