utils#

Utility functions for the Marketing Mix Modeling module.

Functions

add_noise_to_channel_allocation(df, channels)

Return df with additive Gaussian noise applied to channels columns.

apply_sklearn_transformer_across_dim(data, ...)

Apply a scikit-learn transformer across a dimension of an xarray DataArray.

create_index(dims, take)

Create an index to take the first dimension of a tensor based on the provided dimensions.

create_new_spend_data(spend, ...[, ...])

Create new spend data for the channel forward pass.

create_zero_dataset(model, start_date, end_date)

Create a DataFrame for future prediction, with zeros (or supplied constants).

transform_1d_array(transform, y)

Transform a 1D array using a scikit-learn transformer.