specparam.io.models.save_model¶
- specparam.io.models.save_model(model, file_name, file_path=None, append=False, save_results=False, save_settings=False, save_data=False, save_base=None)[source]¶
Save out data, results and/or settings from a model object into a JSON file.
- Parameters:
- modelSpectralModel
Object to save data from.
- file_namestr or FileObject
File to save data to.
- file_pathPath or str, optional
Path to directory to save to. If None, saves to current directory.
- appendbool, optional, default: False
Whether to append to an existing file, if available. This option is only valid (and only used) if ‘file_name’ is a str.
- save_resultsbool, optional
Whether to save out model fit results.
- save_settingsbool, optional
Whether to save out settings.
- save_databool, optional
Whether to save out input data.
- save_basebool, optional
Whether to save out base data. Can be set to False to remove redundant information when saving from multiple models.
- Raises:
- ValueError
If the save file is not understood.