ipm_model

ipm_model(
    data=None,
    outcome=None,
    rating_prefix=None,
    method='rwa',
    recode=True,
    likert_levels=None,
)

Build an importance / performance model.

Combines driver importance (against outcome) with feature performance (mean rating) into the table plot_ipm() draws. An importance/performance model answers two questions per feature at once: how much does it drive the outcome (importance, via calc_importance()) and how well are we doing on it (performance, the mean 1-5 rating). Plotting one against the other reveals priorities: high-importance, low-performance features are where to invest. Worded rating columns are mapped to 1-5 with recode_likert() automatically; the prefix is stripped from feature names; and perf_class buckets performance into a 1-5 categorical by its integer part (a 3.57 mean is band 3, not 4) for colouring.

Parameters

Name Type Description Default
data pandas.DataFrame A data frame. If omitted, the session default is used. None
outcome str The outcome column, e.g. “nps_value”. None
rating_prefix str Column-name prefix identifying the rating block, e.g. “ratings_”. None
method str How to measure importance, passed to calc_importance(). Default “rwa”. 'rwa'
recode bool If True (default), text rating columns are mapped to 1-5 with recode_likert(); numeric columns are left as-is. True
likert_levels list of str Scale wordings passed to recode_likert() when recoding. None

Returns

Name Type Description
pandas.DataFrame feature, importance, performance and perf_class (the performance band as a 1-5 categorical).

See Also

calc_importance, plot_ipm, compare_values

Examples

>>> ipm_model(podracing_survey, "nps_value", "ratings_")