MixedLogit.prepare_X_matrix#
- MixedLogit.prepare_X_matrix(df, utility_formulas, depvar)[source]#
Prepare the design matrices for the utility equations.
Creates: - X: Alternative-specific covariates (N x J x K) - F: Fixed covariates (N x K_fixed) or None - List of alternative names - Array of unique fixed covariate names - List of random covariate names
- Returns:
tuple(X, F, alternatives, fixed_covar_names, random_covar_names)