[R] Predict.nnet ?
Yves Gauvreau
cyg at sympatico.ca
Wed Oct 25 11:54:55 CEST 2000
Here is what I have
> library(nnet)
> package.description("nnet")$Version
[1] "6.2-1"
data.x <- data.frame(p1=p1, p2=p2, p3=p3, p4=p4, p5=p5)
dim(data.x) => 4583 100
dim(data.y) => 4583 3 {matrix}
samp <- sample(1:nrow(data.y), 1500)
data.nn <- nnet.default(x=data.x[samp,], y=data.y[samp,], size=20, rang=0.1,
skip=T, MaxNWts=2500, linout=T, decay=2.5e-4, maxit=100)
**** a call to nnet(...) only complains about missing argument
I hit the return key and nnet start doing it's job to the end without
complaining.
data.predict <- predict(data.nn, data.x[-samp,])
Run for a little while (a few seconds) and I get a message box:
Rgui.exe Application error
The instruction at 0x10001181 reference memory at 0x05fb1000
The memory could not be read.
Click OK to terminate.
Click on CANCEL to debug
*********
I was using R 1010 so I though the problem could be because I don't have the
latest version. So I downloaded and installed the latest release of both R
and VR yesterday before posting the help request.
I'm surprise as you may be (Ripley) that I can train the network with no
obvious problem and that when I try to test the results using predict it
doesn't work. I understand that the forward pass needed by the nnet code to
compute the error, gradient and hessian (if asked for) should be the same.
It seems though, there could be a different approach for each?
I even tried this
data.predict <- predict(data.nn, data.x[100:120,])
with the same result.
Anyway, I though I may be using the library the wrong way? I don't know and
I'm still puzzle!
Any suggestion on how to figure out what's wrong?
Yves Gauvreau
----- Original Message -----
From: "Prof Brian D Ripley" <ripley at stats.ox.ac.uk>
To: "Yves Gauvreau" <cyg at sympatico.ca>
Cc: <r-help at stat.math.ethz.ch>
Sent: Wednesday, October 25, 2000 2:17 AM
Subject: Re: [R] Predict.nnet ?
> On Tue, 24 Oct 2000, Yves Gauvreau wrote:
>
> > Hi,
> >
> > I have a problem with predict.nnet when I try to use it. It crashes R
with a
> > memory access violation.
>
> It should tell you in which DLL, which would help.
>
> > platform Windows
> > arch x86
> > os Win32
> > system x86, Win32
> > status
> > major 1
> > minor 1.1
> > year 2000
> > month August
> > day 15
> > language R
> >
> > I admit the data set is quite large ~ [3000, 101] and its a 3 class
problem.
> > I know that it works fine when there is a single target. I wonder if
what
> > I'm doing is wrong or if could be a bug of some kind?
>
> Not really much there to go on, I'm afraid. You do have the latest
version
> of the VR bundle? (9.2-1: package.description("nnet")$Version will tell
> you). There was an R-related memory-management problem on a few platforms
> (not Solaris, yes on Linux PPC, seen once on Linux i386, in nnet not
> predict.nnet) in the immediately previous release (6.1-9, perhaps also
> 6.1-8).
>
> Certainly you should be able to do this, and the scripts in the bundle
> do an example with three output and predicting to a large set.
> As a workaround, does predicting to a smaller set of observations help?
> You can then build up the big prediction in pieces.
>
> --
> Brian D. Ripley, ripley at stats.ox.ac.uk
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272860 (secr)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-
> r-help mailing list -- Read
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
>
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list