plot_ipm

plot_ipm(model, title=None, repel=True, bands=None)

Importance / performance matrix.

Plots an ipm_model() table as a scatter of feature performance (x) against importance (y), with decision bands across the top. Each point takes the colour of the decision band it falls in, so a feature averaging 2.4 is red because it sits in the BAD band: the point and the band behind it can never disagree. Read it by quadrant: high-importance, low-performance features (upper left) are the priorities to fix, while high-importance, high-performance features (upper right) are strengths to protect. The performance axis runs over the scale the bands describe; a point outside it is reported, and rescale_bands() moves the bands onto the scale the answers were collected on. Uses adjustText (the repel extra) for non-overlapping labels when it is installed.

Parameters

Name Type Description Default
model pandas.DataFrame An ipm_model() output (feature, importance, performance, perf_class). required
title str Title; defaults to the average performance. None
repel bool Keep labels from overlapping when adjustText is installed. Default True. True
bands pandas.DataFrame Decision bands drawn across the top and used to colour the points. Default bands_rating_3() (BAD 1-3, OK 3-4, GOOD 4-5). None

Returns

Name Type Description
plotnine.ggplot The chart.

See Also

ipm_model, compare_values, rescale_bands

Examples

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