Neuralnet package in R big error

Viewed 6363

I am trying to figure out how to make the neuralnet package to work. I did some tests with data I created and with their outcomes (about 50 rows of data and three columns with the fourth being the outcome I wanted and it was made from simple mathematical executions like summing the other three columns) and so far so good. Then I decided to apply the package on real data. I downloaded the mpg dataset from here http://vincentarelbundock.github.io/Rdatasets/datasets.html

I was running the code bellow:

net<- neuralnet(cty~displ+year+cyl+hwy,
                datain, hidden=3)

Even if I have 3 hidden layers, or 8 or 18 the error is the same and the time that the package processes the data is relatively small from this amount of data (234 lines):

        Error Reached Threshold Steps
1 2110.173077    0.006277805853    54

Any good advice for this?

2 Answers

Have you tried enabling linear output in your neural net model through linear.output=TRUE label?

neuralnet(formula, data, hidden = 1, threshold = 0.01,
  stepmax = 1e+05, rep = 1, startweights = NULL,
  learningrate.limit = NULL, learningrate.factor = list(minus = 0.5,
  plus = 1.2), learningrate = NULL, lifesign = "none",
  lifesign.step = 1000, algorithm = "rprop+", err.fct = "sse",
  act.fct = "logistic", ****linear.output = TRUE****, exclude = NULL,
  constant.weights = NULL, likelihood = FALSE)
Related