optimizer_xarray_builder#

pymc_marketing.mmm.budget_optimizer.optimizer_xarray_builder(value, **kwargs)[source]#

Create an xarray.DataArray with flexible dimensions and coordinates.

Parameters:
- value (array-like): The data values for the DataArray. Shape must match the dimensions implied by the kwargs.
- **kwargs: Key-value pairs representing dimension names and their corresponding coordinates.
Returns:
  • xarray.DataArray: The resulting DataArray with the specified dimensions and values.
Raises:
  • ValueError: If the shape of value doesn’t match the lengths of the specified coordinates.