tag:blogger.com,1999:blog-2474498300859593807.post4033270624319402508..comments2024-03-08T02:53:17.969-05:00Comments on Econometric Sense: R Code Example for Neural NetworksMatt Bogardhttp://www.blogger.com/profile/10510725993509264716noreply@blogger.comBlogger24125tag:blogger.com,1999:blog-2474498300859593807.post-26237307316981711922013-12-18T06:07:38.017-05:002013-12-18T06:07:38.017-05:00Are we sure that this package works properly? I am...Are we sure that this package works properly? I am trying to figure it out with the simplest of data, and even though it gives the very known error: Warning message:<br />algorithm did not converge in 1 of 1 repetition(s) within the stepmax <br /><br />or a huge Error in the network prediction that makes outputs have no sense. It doesn't even working with the simple data table when you have a first column a number and the second column is numbers' 2X and as output you want the sum of these two columns...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-91276591304779032652012-11-14T21:03:41.824-05:002012-11-14T21:03:41.824-05:00Do you know how to interpret the error in the outp...Do you know how to interpret the error in the output? Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-80349172070192509412012-11-14T11:36:13.496-05:002012-11-14T11:36:13.496-05:00Anil, I really want to work on this when I get tim...Anil, I really want to work on this when I get time. I've done it with SAS Enterprise Miner but have not demonstrated it in R. I will as soon as I can! Thanks.Matt Bogardhttps://www.blogger.com/profile/10510725993509264716noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-23839832863082685062012-11-14T03:06:59.293-05:002012-11-14T03:06:59.293-05:00I am testing out your codes on a sample data that ...I am testing out your codes on a sample data that I have. Can you please share me some method of obtaining forecasts using the network thus obtained.Anil Antonoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-2867165805383190742012-09-19T21:28:26.590-04:002012-09-19T21:28:26.590-04:00Hello Gayathri..
I am starting to work with neural...Hello Gayathri..<br />I am starting to work with neuralnet.<br />Did you discovered if it is possible specify the maximum number of epochs or the target error rate??<br /><br />Thank you..<br />Flávia Cristinahttps://www.blogger.com/profile/02036157915922661122noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-21824042610791035912012-09-01T03:05:17.113-04:002012-09-01T03:05:17.113-04:00From the perspective of R, how do we use the resul...From the perspective of R, how do we use the result of the neural network exercise? Do we come up with an equation? Does it work like a regression equation where, after the procedure, we can just plug in numbers to get a predicted value?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-11515576842702124042012-06-07T02:19:39.835-04:002012-06-07T02:19:39.835-04:00Can we use Neural net R packages for predicting Co...Can we use Neural net R packages for predicting Continuous data like prices, <br />If yes what changes we need to make in the code u have given above.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-82107993923904126632012-05-25T10:28:24.339-04:002012-05-25T10:28:24.339-04:00I have the same problems:
> nn$result.matrix
N...I have the same problems:<br /><br />> nn$result.matrix<br />NULL<br /><br />or<br /><br />algorithm did not converge in 1 of 1 repetition(s) within the stepmax<br /><br />-------------------------------------<br />Does this mean that algorithm didn't find any relationships between dependent variable and covariates?<br /><br />Thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-78656268088009509222012-04-25T03:58:18.649-04:002012-04-25T03:58:18.649-04:00Dear matt,
I am trying to use Nnet for predicting...Dear matt,<br /><br />I am trying to use Nnet for predicting continous data, wil it work? my dependent is a gamma distributed varible, so i used ur code but with little tweek for linout=true. but i am not getting results. please see the error below and advice me what other changes can be made <br /><br />> nn <- nnet(Low.formula~Type.of.property+Type.of.occupation+Job+Number.of.rooms, data=France1, size=1, skip=FALSE, maxit=1000,hidden=1, err.fct="ce", linout=TRUE)<br /># weights: 12<br />initial value 19575694.371960 <br />iter 10 value 1513776.253055<br />iter 20 value 1205329.256042<br />iter 30 value 1046068.800635<br />iter 40 value 969627.109067<br />iter 50 value 739564.881771<br />iter 60 value 727653.907905<br />iter 70 value 661323.506699<br />final value 661205.493839 <br />converged<br />> nn$result.matrix<br />NULL<br />> plot(nn)<br />Error in xy.coords(x, y, xlabel, ylabel, log) : <br /> 'x' is a list, but does not have components 'x' and 'y'<br />> fix(nn)<br />Warning message:<br />In edit.default(get(subx, envir = parent), title = subx, ...) :<br /> deparse may be incomplete<br />> weights(nn)<br />NULL<br /><br /><br />thank youtrinoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-53179394293280662212012-04-16T06:08:02.708-04:002012-04-16T06:08:02.708-04:00Use Size option, you will get the weights
> nn&...Use Size option, you will get the weights<br />> nn<-nnet(case~age+parity+induced+spontaneous,data=infert, size=10, hidden=2,linear.output=FALSE)<br /># weights: 61<br />initial value 88.005015 <br />final value 83.000000 <br />convergedtrinoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-89560446662880481352012-04-16T04:26:48.619-04:002012-04-16T04:26:48.619-04:00i am getting below error, when i run above code
&...i am getting below error, when i run above code<br /><br />> nn <- neuralnet(case~age+parity+induced+spontaneous, data=infert, hidden=2, err.fct="ce", linear.output=FALSE)<br />Warning message:<br />algorithm did not converge in 1 of 1 repetition(s) within the stepmaxAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-43649040670770796062012-02-18T15:15:54.648-05:002012-02-18T15:15:54.648-05:00You're right that people, notably Brian Ripley...You're right that people, notably Brian Ripley, can get snarky about poorly written questions, but I found a lot of people willing to help me when I was first learning R and most beginner questions already have answers. Try a google search like "R how to install package" etc. Also take a look at the posting guide before posting:<br /><br />http://www.r-project.org/posting-guide.htmlAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-91864079839681086152012-01-17T05:49:47.154-05:002012-01-17T05:49:47.154-05:00How to test model using neural network in R..? Ple...How to test model using neural network in R..? Please help me..Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-84313707564522765512011-12-21T08:17:37.145-05:002011-12-21T08:17:37.145-05:00Thanks!Thanks!Matt Bogardhttps://www.blogger.com/profile/10510725993509264716noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-7702431181257752562011-12-21T04:47:04.561-05:002011-12-21T04:47:04.561-05:00Anonymous is not using the correct package ('n...Anonymous is not using the correct package ('neuralnet', rather than 'nnet' - I am guessing nnet doesn't have the dataset... After loading nnet I got the same error, but the post's neuralnet example ran fine.oliverslayhttps://www.blogger.com/profile/06453980932298730974noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-53063685753936456392011-06-24T09:51:05.915-04:002011-06-24T09:51:05.915-04:00@ Anonymous & Anonymous- I'll have to look...@ Anonymous & Anonymous- I'll have to look at these issues- I'm not sure I'll get the answer. I'm still just learning these techniques and the code too! But my purpose of this blog is to facilitate more learning. I can barely keep up with new posts, ( I have a lot more I want to write) not to mention addressing these issues. <br /><br />In the mean time, typically what I do when I have an issue like this, is I'll make a blog post and ask the question via twitter (with a link to the post like this one) using the #rstats hash tag. Stack overlfow is another web site that is useful to post questions about R-code, as well as the R-user group. If you have a linkedin profile, I notice that R-users are often using the linkedin R user interest group for these kind of discussions. <br /><br />If feel bad for not providing you with a direct answer, but hopefully one of these resources will be helpful.Matt Bogardhttps://www.blogger.com/profile/10510725993509264716noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-89701674284608848752011-06-24T06:03:20.796-04:002011-06-24T06:03:20.796-04:00I have a question on how to predict future ts-valu...I have a question on how to predict future ts-values after a svm-regression:<br />If I execute:<br /><br />library(e1071)<br />library(dyn)<br />y=c(0,2,1,3,2,4,3,5,4,6,5,7,6,8,7,9,8,10,9,11)<br />y<-ts(y)<br />y.svm <- dyn$svm(y ~ lag(y))<br />yp <- predict(y.svm)<br />ts.plot(y, yp, col = 1:2)<br /><br />I only get values for yp[1] .. yp[19]<br /><br />What do I have to do to get future values yp[20] .. yp[26] for example?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-62642603508348519952011-06-16T09:15:56.139-04:002011-06-16T09:15:56.139-04:00I write:
>library(datasets)
>names(infert)
...I write:<br /><br />>library(datasets)<br />>names(infert)<br />>nn <- nnet(case~age+parity+induced+spontaneous, data=infert, hidden=2, err.fct="ce", linear.output=FALSE)<br /><br />But error occurs:<br />Erro em c(dim(x)[2L], size, dim(y)[2L]) : 'size' is missing<br /><br />How to solve? ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-87146823854063133052011-03-15T12:02:57.459-04:002011-03-15T12:02:57.459-04:00@Gyathri- I'm not sure about this. I first lea...@Gyathri- I'm not sure about this. I first learned about Neural nets via the Rattle Package in R, and the journal article I cited above. I would like to know more if I get time to dig into it. If you use twitter, you might send out a tweet with #rstats hash tag and ask about this. I might if I get a chance in the future. You could try the R help listserv, but I've never used it as I've heard so much about it not being user friendly or welcoming to anyone that is not an expert in R.Matt Bogardhttps://www.blogger.com/profile/10510725993509264716noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-33199253957071479862011-03-14T19:11:45.732-04:002011-03-14T19:11:45.732-04:00Thanks Matt, this is very useful. Do you know how ...Thanks Matt, this is very useful. Do you know how we can specify the maximum number of epochs or the target error rate?Gayathrinoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-49970528463719162562011-03-14T09:39:55.014-04:002011-03-14T09:39:55.014-04:00Note- to read the code you may have to use the pre...Note- to read the code you may have to use the pretty R scroll bar, or you should be able to copy and paste into a text doc or editor.Matt Bogardhttps://www.blogger.com/profile/10510725993509264716noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-81162763621088964832011-03-14T09:38:44.196-04:002011-03-14T09:38:44.196-04:00I've now included the code I used, but I have ...I've now included the code I used, but I have to say, each time I run it I get different results. I'm not sure if there is an option for specifying a seed or some way to get consistent results. there is also a lot more I need to know about interpreting the output beyond what I've already posted. Probably time to give the journal article and documentation a second read.Matt Bogardhttps://www.blogger.com/profile/10510725993509264716noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-76172139472499999882011-03-14T09:14:36.752-04:002011-03-14T09:14:36.752-04:00I will try to find the program and post the code a...I will try to find the program and post the code and add some instructions. In the mean time I would refer you to http://journal.r-project.org/archive/2010-1/RJournal_2010-1_Guenther+Fritsch.pdf<br /><br />which is the link to the article I cited. It provides much more detail and instructions for loading the package etc.Matt Bogardhttps://www.blogger.com/profile/10510725993509264716noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-19039100693105035942011-03-13T15:20:14.604-04:002011-03-13T15:20:14.604-04:00I am a newbie. Would you mind writing all commands...I am a newbie. Would you mind writing all commands needed to run the example you gave? How to load the package and stuff? Many thanksAnonymousnoreply@blogger.com