本文介绍了随机森林的可解释性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 sklearn RandomForestClassifier 来解决二进制分类问题.

I have been using the sklearn RandomForestClassifier to solve a binary classification problem.

对于特定的样本预测,我希望能够知道如何更改特征的值以使预测发生变化.

For a particular sample prediction, I would like to be able to know how to change the features' values to make the prediction change.

例如假设我有一个 [size = 15, width = 8, height = 13] 的条目,模型给了我一个 probability = 0.9 属于 类1.我想说的是将 size15 更改为 10"然后是您的 probability=0.1,例如.

E.g. let's say I have an entry with [size = 15, width = 8, height = 13] and the model gives me aprobability = 0.9 to be of class 1. What I would like to be able to say is "change size from 15 to 10" and then your probability=0.1 for example.

那么最理想的是,我想要的是最小的梯度"在从一类移动到另一类(或概率变化最大的类)的特征值中.

Then optimally, what I would like is the smallest "gradient" in the features values to move from one class to another (or the one that gives the most change in probability).

也许我错了,但从我读过的包 LIME 和 TreeInterpreter 没有提供这种信息?

Maybe I'm wrong but from what I've read the packages LIME and TreeInterpreter do not provide this kind of information?

推荐答案

部分依赖图近似于目标与在所有其他自变量上边缘化的特定自变量之间的依赖关系.

Partial dependence plots approximate the dependence between the target and a particular independent variable marginalised on all other independent variables.

虽然它没有在所有点给出精确的梯度.它有助于我们直观地了解变量的行为.

While it doesn't give exact gradient at all points. It helps us get an intuition of the variable behavior.

您可以在这里找到更多相关信息:https://scikit-learn.org/stable/modules/生成/sklearn.inspection.plot_partial_dependence.html

You can find more about it here:https://scikit-learn.org/stable/modules/generated/sklearn.inspection.plot_partial_dependence.html

这篇关于随机森林的可解释性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 18:50