CumulativeFeatureImpactPlot
CumulativeFeatureImpactPlot[model,data]
plots the cumulative impact of the value of each feature in data on the result of model.
CumulativeFeatureImpactPlot[model]
estimates the feature impacts using synthetic data.
CumulativeFeatureImpactPlot[modelfname,…]
plots only the impact of the specified feature fname.
CumulativeFeatureImpactPlot[modelfnameclass,…]
plots only the impact on the classification class.
Details and Options
- CumulativeFeatureImpactPlot is used to interpret the contribution of examples' feature values to the results of a machine learning model such as a regression or a classification.
- Feature impacts are typically used to give insights into the decision process of an otherwise "black-box" machine learning algorithm, understand the model's inner workings, prevent unwanted biases, etc.
- For every example, the impact of each feature is accumulated until they fully explain the model result.
- Possible values for model are:
-
ClassifierFunction[…] a classification model PredictorFunction[…] a regression model FittedModel[…] a symbolic fitted model - The final impact on a predictor result is the deviation for the average prediction.
- The final impact on a classifier is the deviation from the prior log-odds for a given class.
- Possible values for data are:
-
example a single example {example1,…} a List, Association or Dataset of examples LearnDistribution[…] a distribution from which to generate synthetic examples Automatic uses the model's missing imputer to generate examples - If no data is provided, synthetic examples will be generated using the model's missing imputer.
- Possible values for fname are:
-
All impact of all the features (default) feature impact of feature only {feature1,…} impact of a list of featurei - When model is a ClassifierFunction[…], possible values for class are:
-
All impact on all the classes (default) name impact on class name only {name1,…} impact on a list of namei - CumulativeFeatureImpactPlot has the same options as Graphics, with the following additions and changes: [List of all options]
-
AspectRatio 1/GoldenRatio ratio of height to width Axes True whether to draw axes AxesLabel Automatic axes labels DataRange Automatic the range of x values to assume for data IntervalMarkers Automatic how to render uncertainty IntervalMarkersStyle Automatic style for uncertainty elements Filling None how to fill in stems for each point FillingStyle Automatic style to use for filling Joined True whether to join points LabelingFunction Automatic how to label points LabelingSize Automatic maximum size of callouts and labels MultiaxisArrangement None how to arrange multiple axes for data PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLabel Automatic overall label for the plot PlotLabels Automatic labels for data PlotLayout "Overlaid" how to position data PlotLegends None legends for data PlotMarkers None markers to use to indicate each point PlotRange Automatic range of values to include PlotRangeClipping True whether to clip at the plot range PlotStyle Automatic graphics directives to determine styles of points PlotTheme $PlotTheme overall theme for the plot ScalingFunctions Automatic how to scale individual coordinates TargetUnits Automatic units to display in the plot -
AlignmentPoint Center the default point in the graphic to align with AspectRatio 1/GoldenRatio ratio of height to width Axes True whether to draw axes AxesLabel Automatic axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool DataRange Automatic the range of x values to assume for data Epilog {} primitives rendered after the main plot Filling None how to fill in stems for each point FillingStyle Automatic style to use for filling FormatType TraditionalForm the default format type for text Frame False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic IntervalMarkers Automatic how to render uncertainty IntervalMarkersStyle Automatic style for uncertainty elements Joined True whether to join points LabelingFunction Automatic how to label points LabelingSize Automatic maximum size of callouts and labels LabelStyle {} style specifications for labels Method Automatic details of graphics methods to use MultiaxisArrangement None how to arrange multiple axes for data PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLabel Automatic overall label for the plot PlotLabels Automatic labels for data PlotLayout "Overlaid" how to position data PlotLegends None legends for data PlotMarkers None markers to use to indicate each point PlotRange Automatic range of values to include PlotRangeClipping True whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotStyle Automatic graphics directives to determine styles of points PlotTheme $PlotTheme overall theme for the plot PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame ScalingFunctions Automatic how to scale individual coordinates TargetUnits Automatic units to display in the plot Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks
List of all options
Examples
open allclose allBasic Examples (2)
Train a model to predict a variable from two features:
Visualize the incremental contribution of each feature to the final result:
Train a classification model on the Titanic Survival dataset:
The "SurvivalStatus" class is predicted according to three features:
Visualize the cumulative impact of all the feature on the "survived" classification for some examples:
Scope (4)
Applications (1)
Analyze the features a model uses in its internal scoring of wine bottles:
Train a model to predict the quality of a wine bottle:
Visualize the cumulative impact of the bottle features on the result using 10 examples:
Analyze only the 50 bottles that the model scores highest:
While most bottle score high due to the alcohol content the top bottles are determined by volatile acidity:
This is a property of the model score that does not reflect its behavior on the highest training scores:
Text
Wolfram Research (2022), CumulativeFeatureImpactPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/CumulativeFeatureImpactPlot.html.
CMS
Wolfram Language. 2022. "CumulativeFeatureImpactPlot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CumulativeFeatureImpactPlot.html.
APA
Wolfram Language. (2022). CumulativeFeatureImpactPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CumulativeFeatureImpactPlot.html