有没有办法用 Keras 获得可变的重要性? [英] Is there any way to get variable importance with Keras?

查看:19
本文介绍了有没有办法用 Keras 获得可变的重要性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种适当或最佳的方法来在使用 Keras 创建的神经网络中获得可变重要性.我目前的做法是,假设第一层中更重要的变量将具有更高的权重,我只取第一层中变量的权重(而不是偏差).还有其他/更好的方法吗?

I am looking for a proper or best way to get variable importance in a Neural Network created with Keras. The way I currently do it is I just take the weights (not the biases) of the variables in the first layer with the assumption that more important variables will have higher weights in the first layer. Is there another/better way of doing it?

推荐答案

因为所有的东西都会沿着网络混杂在一起,所以仅靠第一层并不能告诉你每个变量的重要性.下面的层也可以增加或减少它们的重要性,甚至可以使一个变量影响另一个变量的重要性.第一层中的每个神经元本身也会赋予每个变量不同的重要性,所以这不是那么简单.

Since everything will be mixed up along the network, the first layer alone can't tell you about the importance of each variable. The following layers can also increase or decrease their importance, and even make one variable affect the importance of another variable. Every single neuron in the first layer itself will give each variable a different importance too, so it's not something that straightforward.

我建议您使用包含零数组的输入来执行 model.predict(inputs),使输入中只有您想要研究的变量为 1.

I suggest you do model.predict(inputs) using inputs containing arrays of zeros, making only the variable you want to study be 1 in the input.

这样,您就可以单独看到每个变量的结果.尽管如此,这仍然无法帮助您处理一个变量增加另一个变量的重要性的情况.

That way, you see the result for each variable alone. Even though, this will still not help you with the cases where one variable increases the importance of another variable.

这篇关于有没有办法用 Keras 获得可变的重要性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆