0% found this document useful (0 votes)
9 views6 pages

Ann 1

Uploaded by

Omo Naija
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views6 pages

Ann 1

Uploaded by

Omo Naija
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Anybody can ask a question

Cross Validated is a question and answer site


for people interested in statistics, machine
learning, data analysis, data mining, and data
visualization. It only takes a minute to sign up. Anybody can answer

Sign up to join this community The best answers are voted up and
rise to the top

How do I interpret the regression output using Artificial


Neural Network in R? [closed]
Asked 3 years, 5 months ago Modified 3 years, 4 months ago Viewed 740 times

Closed. This question needs details or clarity. It is not currently accepting answers.

1 Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.

Improve this question

I'm working on a covid-19 dataset, and I'm interested in using the Artificial Neural Network
(ANN) to measure the effect of some independent variables namely: confirmed cases, new
cases, and total deaths on the response variable new deaths. The attached is the output using
R Kindly explain how to explain this output, it does not look like the normal linear regression
I'm familiar with.
.

r regression multiple-regression linear-model intercept

Share Cite Improve this question Follow asked Sep 24, 2020 at 11:04
Seyi
121 4

4 It does not look like the normal linear regression because it is not a linear regression. If you want to
use neural nets you will have to learn, what they are. It will be really hard to answer your question
withouht further indication, what knowledge of neural nets you already have so one can built upon that.
– Bernhard Sep 24, 2020 at 12:17

2 Answers Sorted by: Highest score (default)

Let's simplify your figure and understand at a more generalized level. This neural network has
three layers: Input, Hidden and Output. Each layer has multiple neurons whose activations are
3 determined by:

Activations of neurons from previous layer

Weights and bias


Since this is a fully connected neural network or dense network, there are weights between
layer number
each neuron between the layers. I have denoted weights by θi,j , and bias with
layer number
b
j
where i is the neuron from previous layer and j is the current neuron.

Now coming back to the figure you have provided, here are some example of weights and
biases using my notation:

2
θ = 0.35826
1,1

2
θ = −6.11547
2,1

3
θ = −2.24362
3,1

2
b = 0.85928
1

3
b = 0.01803
1

and so on...
Now that we know what each symbol means let's write some equations to get activation of
each neuron. Let's assume a tanh activation function.

Second layer activations can be written as:

2 2
h1 = tanh(θ x1 + θ x2
1,1 2,1

2 2 2
+ θ x3 + b ) = tanh( ∑ θ
3,1 1 i,1

i=1:3

2
xi + b )
1

2 2
h2 = tanh( ∑ θ xi + b )
i,2 2

i=1:3

3 2
h3 = tanh( ∑ θ xi + b )
i,2 3

i=1:3

And finally the output layer activations can be written as:

3 3
y = tanh( ∑ θ hi + b )
i,1 1

i=1:3
Share Cite Improve this answer Follow answered Sep 25, 2020 at 16:12
kedarps
3,532 2 22 30

Black represents the parameter weights.

Blue represents the bias terms (kind of like the intercept in linear regression).
2
To get the value of a neuron (black circle) towards the right, take the value in the circles to the
left, multiply by the weight on the connecting line, and add up those values for all circles
pointing towards your circle. We’d typically use a nonlinear activation function, too, such a
ReLU, though you have not indicated what you used (if any).

I recommend writing out the full equation of this small neural network, and I hope no one
ruins the fun for you before you try to work through it.

EDIT

g = activation(0.01803

+ 2.31748d + 1.00955e

− 2.24362f )
Use this to unpack the other six neurons. Then write g in terms of the three predictor
variables.

Share Cite Improve this answer edited Sep 29, 2020 at 16:38 answered Sep 24, 2020 at 11:09
Follow Dave
60.8k 7 93 268

1 Use the picture to write down the equation on a sheet of paper. No knowledge of R or any other
software is necessary for this. (Well...you’ll have to know the activation functions in each neuron,
which you’ll get from your code.) – Dave Sep 24, 2020 at 11:28

1 Using the package neuralnet the preset activation function will be logistic, unless other options
were chosen. – Bernhard Sep 24, 2020 at 12:14

1 @user2579677 you are missing the effect of the activation functions – desertnaut Sep 24, 2020 at
14:05

1 @user2579677 You've missed the activation functions and the multiple layers. Take another shot,
making use of all 16 numbers in your picture. – Dave Sep 24, 2020 at 14:20

1 Well I got g by adding up something about the arrows points towards it. Take a shot at writing d by
considering the arrows pointing towards it. – Dave Oct 1, 2020 at 14:13

You might also like