有什么方法可以使Keras变得越来越重要? [英] Is there any way to get variable importance with Keras?

查看:78
本文介绍了有什么方法可以使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天全站免登陆