bips-hb / neuralnet

Training of Neural Networks
30 stars 12 forks source link

RStudio and neuralnets gwplot does not work #28

Open Oakwilde opened 5 years ago

Oakwilde commented 5 years ago

It works fine in R by itself

mnwright commented 5 years ago

Works here. Could you give a reproducible example?

Oakwilde commented 5 years ago

Here is an example. Thanks.

Richard

library(car) data(Arrests) attach(Arrests) Released<-ifelse(released=="Yes",1,0) Black<-ifelse(colour=="Black",1,0) Year<-year Age<-age Male<-ifelse(sex=="Male",1,0) Employed<-ifelse(employed=="Yes",1,0) Citizen<-ifelse(citizen=="Yes",1,0) Checks<-checks detach(Arrests) work1<-data.frame(Released,Black,Age,Year,Male,Employed, Citizen,Checks) nn1<-neuralnet(Released~.,data=work1,hidden=c(2,2), linear.output = F,err.fct = "ce", rep=3) print(nn1) # no GWs computed

Richard Berk berkr@sas.upenn.edu

From: "Marvin N. Wright" notifications@github.com Reply-To: bips-hb/neuralnet reply@reply.github.com Date: Wednesday, April 3, 2019 at 8:05 AM To: bips-hb/neuralnet neuralnet@noreply.github.com Cc: "Berk, Richard A" berkr@sas.upenn.edu, Author author@noreply.github.com Subject: Re: [bips-hb/neuralnet] RStudio and neuralnets gwplot does not work (#28)

Works here. Could you give a reproducible example?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/bips-hb/neuralnet/issues/28#issuecomment-479460651, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AcqgWrMVGpWXhkN68pTNc-ZaDeBzCTEXks5vdJjygaJpZM4cUa3q.

Oakwilde commented 5 years ago

It works after I scaled all of the predictors. What is strange is that I got weights when I did not scale but no generalized weights. Am I missing something in the documentation?

Thanks.

Richard

Richard Berk berkr@sas.upenn.edu

From: "Marvin N. Wright" notifications@github.com Reply-To: bips-hb/neuralnet reply@reply.github.com Date: Wednesday, April 3, 2019 at 8:05 AM To: bips-hb/neuralnet neuralnet@noreply.github.com Cc: "Berk, Richard A" berkr@sas.upenn.edu, Author author@noreply.github.com Subject: Re: [bips-hb/neuralnet] RStudio and neuralnets gwplot does not work (#28)

Works here. Could you give a reproducible example?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/bips-hb/neuralnet/issues/28#issuecomment-479460651, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AcqgWrMVGpWXhkN68pTNc-ZaDeBzCTEXks5vdJjygaJpZM4cUa3q.

mnwright commented 5 years ago

It seems to be a random issue related to convergence. Might it be that the network didn't converge in the cases where gwplot() did not work? On scaled data it should converge faster, so it would make sense in your case.

Oakwilde commented 5 years ago

Thanks. Yes, that could be it, but I got weights and was able plot the visual of the network. There was also no error message that convergence failed (which I have gotten for other applications).

Richard

Richard Berk berkr@sas.upenn.edu

From: "Marvin N. Wright" notifications@github.com Reply-To: bips-hb/neuralnet reply@reply.github.com Date: Friday, April 5, 2019 at 9:46 AM To: bips-hb/neuralnet neuralnet@noreply.github.com Cc: "Berk, Richard A" berkr@sas.upenn.edu, Author author@noreply.github.com Subject: Re: [bips-hb/neuralnet] RStudio and neuralnets gwplot does not work (#28)

It seems to be a random issue related to convergence. Might it be that the network didn't converge in the cases where gwplot() did not work? On scaled data it should converge faster, so it would make sense in your case.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/bips-hb/neuralnet/issues/28#issuecomment-480281027, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AcqgWuWosw3wraZEoQeqhM2YMqGko7MCks5vd1OTgaJpZM4cUa3q.