utils#

Utility functions for the Marketing Mix Modeling module.

Functions

apply_sklearn_transformer_across_dim(data, ...)

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

compute_sigmoid_second_derivative(x, alpha, lam)

Compute the second derivative of the extended sigmoid function.

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

Create new spend data for the channel forward pass.

drop_scalar_coords(curve)

Remove scalar coordinates from an xarray DataArray.

estimate_menten_parameters(channel, ...)

Estimate the parameters for the Michaelis-Menten function using curve fitting.

estimate_sigmoid_parameters(channel, ...)

Estimate the parameters for the sigmoid function using curve fitting.

find_sigmoid_inflection_point(alpha, lam)

Find the inflection point of the extended sigmoid function.

sigmoid_saturation(x, alpha, lam)

Sigmoid saturation function.

transform_1d_array(transform, y)

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