[R] High error made by Neural network in R

javad bayat j@b@y@t194 @end|ng |rom gm@||@com
Sat Jul 30 08:56:55 CEST 2022


Dear all;
I have run a neural network to predict a variable according to 3
independent variables. I used "neuralnet" package and the codes were:
"
> met = read.csv("./met.csv",header = TRUE, sep = ",")
> attach(met)
> head(met)
> met2 = met
> str(met2)
'data.frame':   211362 obs. of  4 variables:
 $ t    : num  14.9 13.9 16.3 16 13.4 ...
 $ rrr24: num  NA NA NA NA NA NA NA NA NA NA ...
 $ sshn : num  NA NA NA NA NA NA NA NA NA NA ...
 $ u    : num  56.9 67.5 87.1 88.6 82 ...
> met2 = na.omit(met2)
> dim(met2)
[1] 130765      4


> set.seed(7896129)
> test_met <- read.csv("./test_met.csv",header = TRUE, sep = ",")
> attach(test_met)
> head(test_met)
> test_met = na.omit(test_met)
> dim(test_met)
[1] 73778     4

> n2 <- neuralnet(u ~ t + rrr24 + sshn,
               data = met2,
               hidden = 4,
               err.fct = "sse",
               linear.output = TRUE,
               lifesign = 'full',
               rep = 1,
               algorithm = "rprop+",
               stepmax = 100000,
               threshold = 0.01
               )
hidden: 4    thresh: 0.01    rep: 1/1    steps:     138 error:
30691876.99866   time: 6.35 secs

> n2$result.matrix
                              [,1]
error                 3.069188e+07
reached.threshold     8.661171e-03
steps                 1.380000e+02
Intercept.to.1layhid1 1.391861e+01
t.to.1layhid1         2.917817e+00
rrr24.to.1layhid1     1.272637e+01
sshn.to.1layhid1      1.302440e+01
Intercept.to.1layhid2 1.418934e+01
t.to.1layhid2         3.010978e+00
rrr24.to.1layhid2     1.453077e+01
sshn.to.1layhid2      1.373876e+01
Intercept.to.1layhid3 1.458518e+01
t.to.1layhid3         3.028105e+00
rrr24.to.1layhid3     1.315952e+01
sshn.to.1layhid3      1.390079e+01
Intercept.to.1layhid4 1.255582e+01
t.to.1layhid4         2.520585e+00
rrr24.to.1layhid4     1.223544e+01
sshn.to.1layhid4      1.146831e+01
Intercept.to.u        8.018417e+00
1layhid1.to.u         8.222817e+00
1layhid2.to.u         8.355812e+00
1layhid3.to.u         9.095662e+00
1layhid4.to.u         8.024959e+00

> results_met <- neuralnet::compute(n2, test_met[,1:3])
"
I am confused why the error is so high ( 3.069188e+07). Is it a problem
regarding my codes?
Is the prediction made by this neural network accurate?
Sincerely



-- 
Best Regards
Javad Bayat
M.Sc. Environment Engineering
Alternative Mail: bayat194 using yahoo.com

	[[alternative HTML version deleted]]



More information about the R-help mailing list