Python Forum
Neural Network importance weights / coefficients
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Neural Network importance weights / coefficients
#1
I would like to measure the importance / coefficient of each of a modest number of inputs toward a regression output for a neural network. I spent the morning searching for the best way to do this and only found things that worked sometimes or were rather complicated. I am wondering if there is some reason not to just add a delta to the inputs one at a time and rerun the predict function. I wrote the following function to use after doing a standard normalization of the inputs and running a neural network creating the model.

def marginal_effects(Data, model, delta):
    inputcount = Data.shape[1]
    baselevel = model.predict(Data).mean()
    identity = numpy.identity(inputcount)
    effects = numpy.zeros([inputcount, 1])
    for i in range(inputcount):
        addedterm = numpy.zeros([inputcount,inputcount])
        addedterm[i,i] = delta
        multiplier = identity + addedterm
        deltaData = Data.dot(multiplier)
        effects[i] = model.predict(deltaData).mean() - baselevel
    return effects * (1/delta)
And then used a delta of 0.01. And the effects could be rescaled if I wanted the importance weights to add to one. It seems to work, so I am just wondering if this is the preferred way to accomplish the task, and if it isn't, then why not.
Reply
#2
I'm not sure weights in the traditional sense go with neural networks. Instead tend to be used as prediction engines.

If looking for weights, I would use a linear regression model and get the coefficients matrix.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  AR roots for VAR coefficients Scott 2 1,022 Nov-30-2022, 09:23 PM
Last Post: Scott
  Neural network and data analysis from clients survey result pthon3 2 1,864 Mar-17-2022, 02:21 AM
Last Post: jefsummers
  Multilayer Perceptron Neural Network erdemath 3 2,282 Aug-09-2021, 11:07 PM
Last Post: jefsummers
  Get error message in a GAN neural network tutorial jdude50 0 1,649 Oct-22-2020, 11:11 PM
Last Post: jdude50
  Explain Me Neural Network Ai's Harshil 2 1,973 Oct-22-2020, 04:50 AM
Last Post: Harshil
  construction of Neural Network for solving Differential equations arshad 0 1,608 Jun-04-2020, 09:20 AM
Last Post: arshad
  Neural Network mensagem error Dalpi 2 2,826 May-20-2020, 04:03 PM
Last Post: Dalpi
  Outputing LogisticRegression Coefficients (sklearn) RawlinsCross 6 4,657 Feb-27-2020, 02:47 PM
Last Post: RawlinsCross
  coding neural network programmer19890620 4 3,391 Feb-27-2020, 04:26 AM
Last Post: programmer19890620
  Weighted average with multiple weights and groups amyd 0 2,093 Oct-11-2019, 10:30 AM
Last Post: amyd

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020