apply_sklearn_transformer_across_dim#
- pymc_marketing.mmm.utils.apply_sklearn_transformer_across_dim(data, func, dim_name)[source]#
Apply a scikit-learn transformer across a dimension of an xarray DataArray.
Helper function in order to use scikit-learn functions with the xarray target.
- Parameters:
- data
xr.DataArray
The input data to transform.
- func
Callable
[[np.ndarray
],np.ndarray
] scikit-learn method to apply to the data
- dim_name
str
Name of the dimension to apply the function to
- data
- Returns:
xr.DataArray