log_inference_data#

pymc_marketing.mlflow.log_inference_data(idata, save_file='idata.nc')[source]#

Log the DataTree to MLflow as netCDF or Zarr.

The data is written to a temporary directory inside the parent of save_file and removed after upload. If the removal fails, for example because another process still holds a file open on Windows, the directory is left behind rather than failing a fit whose artifact is already logged.

Parameters:
  • idata (DataTree) – The DataTree object returned by the sampling method.

  • save_file (str | Path) – Path whose file name becomes the artifact name and whose suffix picks the format (.zarr for a Zarr directory store, anything else for netCDF). Its parent directory must exist.

Raises:

FileNotFoundError – If the parent directory of save_file does not exist.