FeatureValueImpactPlot[model,data]
绘制 data 中给定特征的值对 model 结果的影响.
FeatureValueImpactPlot[model]
使用合成数据估计特征值的影响.
FeatureValueImpactPlot[modelfname,…]
只绘制指定特征 fname 的影响.
FeatureValueImpactPlot[modelfnameclass,…]
只绘制对分类 class 的影响.
FeatureValueImpactPlot
FeatureValueImpactPlot[model,data]
绘制 data 中给定特征的值对 model 结果的影响.
FeatureValueImpactPlot[model]
使用合成数据估计特征值的影响.
FeatureValueImpactPlot[modelfname,…]
只绘制指定特征 fname 的影响.
FeatureValueImpactPlot[modelfnameclass,…]
只绘制对分类 class 的影响.
更多信息和选项
- FeatureValueImpactPlot 用于解释样例的特征值对机器学习模型(如预测器或分类器)结果的贡献.
- 特征影响通常用于增进对之前如“黑盒”般的机器学习算法的决策过程的了解,以便掌握模型的内部工作原理,防止不必要的偏差等.
- 针对每个样例,将影响
作为
的函数来绘制. 对值
的影响是与均值
的偏差,
: -
- model 可取的值为:
-
ClassifierFunction[…] 分类模型 PredictorFunction[…] 回归模型 - 预测器的结果是一个标量,si 是与平均预测
的偏差. - 分类器的结果通常是一个对数几率向量,作为每个类的概率返回.
- 影响 si 是与给定类别的先验对数几率 logodds0 的偏差.
- data 可取的值为:
-
example 一个样例 {example1,…} 样例组成的 List、Association 或 Dataset Automatic 用模型的缺失值估算器生成样例 - 如果没有提供 data,将根据训练数据用模型的缺失值合成器生成合成样例.
- fname 可取的值为:
-
All 所有特征造成的影响(默认) feature feature 造成的影响 {feature1,…} 一组 featurei 造成的影响 - 当 model 是一个 ClassifierFunction[…] 时,class 可取的值为:
-
All 对所有类别的影响(默认) name 对 name 类别的影响 {name1,…} 对一组 namei 的影响 - FeatureValueImpactPlot 有与 Graphics 相同的选项,不同之处和更多选项如下所示: [所有选项的列表]
-
AspectRatio 1/GoldenRatio 高宽比 Axes True 是否绘制坐标轴 AxesLabel Automatic 坐标轴的标签 DataRange Automatic 假定的数据的 x 值的范围 IntervalMarkers Automatic 怎样表示不确定性 IntervalMarkersStyle Automatic 不确定元素的样式 Filling None 如何填充各个点的茎杆 FillingStyle Automatic 填充使用的样式 Joined False 是否将每个点都连起来 LabelingFunction Automatic 如何标记点 LabelingSize Automatic callout 和标签的最大尺寸 MultiaxisArrangement None 如何排列数据的多个轴 PerformanceGoal $PerformanceGoal 优化的目标 PlotLabel Automatic 绘图的整体标签 PlotLabels Automatic 数据的标签 PlotLayout "Overlaid" 怎样放置数据 PlotLegends None 数据的图例 PlotMarkers None 用于标识每个点的标记 PlotRange Automatic 要包含的值的范围 PlotRangeClipping True 在绘图范围边界处是否进行剪切 PlotStyle Automatic 确定点的样式的图形指令 PlotTheme $PlotTheme 绘图的整体外观主题 ScalingFunctions Automatic 怎样缩放个别坐标 TargetUnits Automatic 显示在绘图中的单位 - ColorData["DefaultPlotColors"] 给出 PlotStyle 使用的默认颜色序列.
所有选项的列表
范例
打开所有单元 关闭所有单元基本范例 (2)
trainingset = Table[x -> 2x - 1, {x, 10}]predictor = Predict[trainingset, Method -> "LinearRegression"]FeatureValueImpactPlot[predictor, Range[10]]predictor[Range[10]] - Information[predictor, "TrainingLabelMean"]data = ResourceData["Sample Data: Fisher's Irises"];
First[data]model = Classify[data -> "Species", Method -> "LogisticRegression"]FeatureValueImpactPlot[model -> "PetalLength", data]范围 (4)
model = Predict[{{1.3, "P"} -> 1, {1.8, "Q"} -> 2.5, {1.9, "Q"} -> 3, {0.2, "P"} -> 1, {-3.2, "P"} -> -4.2, {0.3, "Q"} -> 2}]FeatureValueImpactPlot[model, {{1.3, "P"}, {1.8, "Q"}, {1.9, "Q"}, {0.2, "P"}, {-3.2, "P"}, {0.3, "Q"}}]model = Classify[{{1.5, Blue} -> "A", {3.2, Blue} -> "A", {4.1, Red} -> "B", {5.3, Red} -> "B", {10., Green} -> "C", {12.4, Red} -> "C"}]FeatureValueImpactPlot[model, {{1.5, Blue}, {3.2, Blue}, {4.1, Red}, {5.3, Red}, {10., Green}, {12.4, Red}}]model = Predict[{{1.3, "P"} -> 1, {1.8, "Q"} -> 2.5, {1.9, "Q"} -> 3, {0.2, "P"} -> 1, {-3.2, "P"} -> -4.2, {0.3, "Q"} -> 2}]FeatureValueImpactPlot[model, {{1.3, "P"}, {1.8, "Q"}, {1.9, "Q"}, {0.2, "P"}, {-3.2, "P"}, {0.3, "Q"}}]model = Classify[{{1.5, Blue} -> "A", {3.2, Blue} -> "A", {4.1, Red} -> "B", {5.3, Red} -> "B", {10., Green} -> "C", {12.4, Red} -> "C"}]FeatureValueImpactPlot[model -> All -> "A", {{1.5, Blue}, {3.2, Blue}, {4.1, Red}, {5.3, Red}, {10., Green}, {12.4, Red}}]FeatureValueImpactPlot[model -> All -> {"A", "C"}, {{1.5, Blue}, {3.2, Blue}, {4.1, Red}, {5.3, Red}, {10., Green}, {12.4, Red}}]选项 (12)
AspectRatio (1)
AxesLabel (1)
AxesStyle (1)
Frame (2)
FrameLabel (2)
Filling (1)
MaxPlotPoints (1)
PlotLabel (1)
PlotLegends (1)
data = {{1.5, Blue} -> "A", {3.2, Blue} -> "A", {4.1, Red} -> "B", {5.3, Red} -> "B", {10., Green} -> "C", {12.4, Red} -> "C"};classifier = Classify[data]FeatureValueImpactPlot[classifier, Keys@data]FeatureValueImpactPlot[classifier, Keys@data, PlotLegends -> None]FeatureValueImpactPlot[classifier, Keys@data, PlotLegends -> "Placeholder"]FeatureValueImpactPlot[classifier, Keys@data, PlotLegends -> {"Class: A", "Class: B", "Class: C"}]应用 (1)
trainingset = Flatten@Table[{x, y} -> x * y - 5y, {x, 10}, {y, 10}];
Short[trainingset]predictor = Predict[trainingset, Method -> "LinearRegression"]FeatureValueImpactPlot[predictor, trainingset[[All, 1]], PlotStyle -> PointSize@Medium]predictor2 = Predict[trainingset, Method -> "GradientBoostedTrees"]现在,取决于样例中的其他特征,同样的特征值可能会产生不同的影响:
FeatureValueImpactPlot[predictor2, trainingset[[All, 1]], PlotStyle -> PointSize@Medium]相关指南
-
▪
- 无监督机器学习
文本
Wolfram Research (2022),FeatureValueImpactPlot,Wolfram 语言函数,https://reference.wolfram.com/language/ref/FeatureValueImpactPlot.html.
CMS
Wolfram 语言. 2022. "FeatureValueImpactPlot." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/FeatureValueImpactPlot.html.
APA
Wolfram 语言. (2022). FeatureValueImpactPlot. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/FeatureValueImpactPlot.html 年
BibTeX
@misc{reference.wolfram_2026_featurevalueimpactplot, author="Wolfram Research", title="{FeatureValueImpactPlot}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/FeatureValueImpactPlot.html}", note=[Accessed: 12-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_featurevalueimpactplot, organization={Wolfram Research}, title={FeatureValueImpactPlot}, year={2022}, url={https://reference.wolfram.com/language/ref/FeatureValueImpactPlot.html}, note=[Accessed: 12-September-2026]}