MaxDiffMixedLogit.transform_attributes#
- MaxDiffMixedLogit.transform_attributes(new_attrs)[source]#
Apply the fitted patsy formula to a new attribute frame.
Use this to score hypothetical items that were not in the training pool. Returns a
(n_rows, n_features)numpy array whose columns align withself.feature_names— multiplying by a posterior draw ofbeta_featgives the posterior of the new items’ utilities.- Parameters:
- new_attrs
pd.DataFrame One row per hypothetical item, with the same attribute columns as the training
item_attributes.
- new_attrs
- Raises:
RuntimeErrorIf called on a non-part-worths model (no design info to apply).