NestedLogitPreprocessedData#

class pymc_marketing.customer_choice.nested_logit.NestedLogitPreprocessedData(X, F, y, alternatives, fixed_covar, coords, prod_indices, nest_indices, all_nests, lambda_lkup)[source]#

Arrays and metadata built from choice data before a model is created.

Attributes:
Xnp.ndarray

Alternative-specific covariates of shape (n_obs, n_alts, n_covariates).

Fnp.ndarray or None

Fixed covariates of shape (n_obs, n_fixed_covariates), or None when the utility equations have no fixed covariates.

ynp.ndarray

Encoded choices of shape (n_obs,).

alternativeslist of str

Alternative names in utility-equation order.

fixed_covarnp.ndarray

Unique fixed-covariate names taken from the utility equations.

coordsdict

Coordinates for the PyMC model.

prod_indicesdict of str to int

Mapping from alternative name to its encoded index.

nest_indicesdict of str to np.ndarray

Flat mapping from nest name to sorted alternative indices.

all_nestslist of str

Nest names in the order they appear in the nesting structure.

lambda_lkupdict of str to int

Mapping from nest name to its lambda index.

Methods

Attributes