FeatureImpactPlot
FeatureImpactPlot[model,data]
plots the impact of the value of each feature in data on the result of model.
FeatureImpactPlot[model]
estimates the feature impacts using synthetic data.
FeatureImpactPlot[modelfname,…]
plots only the impact of the specified feature fname.
FeatureImpactPlot[modelfnameclass,…]
plots only the impact on the classification class.
Details and Options
- FeatureImpactPlot 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 distribution of the impact of is plotted. The impact on the result of model is the deviation from the mean according to :
- Possible values for model are:
-
ClassifierFunction[…] a classification model PredictorFunction[…] a regression model FittedModel[…] a symbolic fitted model - The result of a predictor is a scalar value and si is the deviation from the average prediction .
- The result of a classifier is typically a vector of log-odds that are returned as probabilities for each class.
- The impact si is the deviation from the log-odds prior logodds0 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 - FeatureImpactPlot has the same options as Graphics, with the following additions and changes: [List of all options]
-
AspectRatio 1/GoldenRatio overall ratio of height to width BarOrigin Left origin placement for shapes BarSpacing Automatic fractional spacing between shapes ChartBaseStyle Automatic overall style for shapes ChartElementFunction Automatic how to generate raw graphics for shapes ChartLabels Automatic labels for data elements and datasets ChartLayout Automatic overall layout to use ChartLegends None legends for data elements and datasets ChartStyle Automatic style for shapes Frame True whether to draw a frame around the chart LabelingFunction Automatic how to label shapes LabelingSize Automatic maximum size of callouts and labels LegendAppearance Automatic overall appearance of legends Method Automatic what methods to use PerformanceGoal "Speed" aspects of performance to try to optimize PlotTheme $PlotTheme overall theme for the chart ScalingFunctions None how to scale individual coordinates TargetUnits Automatic units to display in the chart -
AlignmentPoint Center the default point in the graphic to align with AspectRatio 1/GoldenRatio overall ratio of height to width Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BarOrigin Left origin placement for shapes BarSpacing Automatic fractional spacing between shapes BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ChartBaseStyle Automatic overall style for shapes ChartElementFunction Automatic how to generate raw graphics for shapes ChartLabels Automatic labels for data elements and datasets ChartLayout Automatic overall layout to use ChartLegends None legends for data elements and datasets ChartStyle Automatic style for shapes ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool Epilog {} primitives rendered after the main plot FormatType TraditionalForm the default format type for text Frame True whether to draw a frame around the chart 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 LabelingFunction Automatic how to label shapes LabelingSize Automatic maximum size of callouts and labels LabelStyle {} style specifications for labels LegendAppearance Automatic overall appearance of legends Method Automatic what methods to use PerformanceGoal "Speed" aspects of performance to try to optimize PlotLabel None an overall label for the plot PlotRange All range of values to include PlotRangeClipping False 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 PlotTheme $PlotTheme overall theme for the chart 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 None how to scale individual coordinates TargetUnits Automatic units to display in the chart Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks
List of all options
Examples
open allclose allBasic Examples (2)
Scope (3)
Text
Wolfram Research (2022), FeatureImpactPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/FeatureImpactPlot.html.
CMS
Wolfram Language. 2022. "FeatureImpactPlot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FeatureImpactPlot.html.
APA
Wolfram Language. (2022). FeatureImpactPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FeatureImpactPlot.html