Displaying 20 results from an estimated 3000 matches similar to: "CVnn2 + nnet question"
2004 Mar 30
1
classification with nnet: handling unequal class sizes
I hope this question is adequate for this list
I use the nnet code from V&R p. 348: The very nice and general function
CVnn2() to choose the number of hidden units and the amount of weight
decay by an inner cross-validation- with a slight modification to use it
for classification (see below).
My data has 2 classes with unequal size: 45 observations for classI and
116 obs. for classII
With
2004 Sep 23
0
nnet with weights parameter: odd error
Dear R-users
I use nnet for a classification (2 classes) problem. I use the code
CVnn1, CVnn2 as described in V&R.
The thing I changed to the code is: I define the (class) weight for each
observation in each cv 'bag' and give the vector of weights as parameter
of nnet(..weights = weight.vector...)
Unfortunately I get an error during some (but not all!) inner-fold cv runs:
2004 Sep 23
0
nnet and weights: error analysis using V&R example
Dear R-users, dear Prof. Ripley as package maintainer
I tried to investigate the odd error, when I call nnet together with a
'weights' parameter, using the 'fgl' example in V&R p 348
The error I get is:
Error in eval(expr, envir, enclos) : Object "w" not found
I think it is a kind of scoping problem, but I really cannot see, what
the problem exactly is.
and
2004 Aug 30
3
Multiple lapply get-around
I am faced with a situation wherein I have to use multiple lapply's. The
pseudo-code could be approximated to something as below:
For each X from i=1 to n
For each Y based on j=1 to m
For each F from 1 to f
Do some calculation based on Fij
Store Xi,Yj = Fij
End For F
End for Y
End for X
Is there anyway to optimize the processing logic further? I *guess*
using the multiple lapply
2010 Jun 17
1
help with nnet
> nnet.fit<-nnet(as.factor(out) ~ ., data=all_h, size=5, rang=0.3,
decay=5e-4, maxit=500) # model fitting
> summary(nnet.fit)
a 23-5-1 network with 126 weights
options were - entropy fitting decay=5e-04
HI, Guys,
I can not find the manual to describe how the model is built, is there a
more detailed description how nnet package works?
--
Sincerely,
Changbin
--
[[alternative
2003 Oct 15
1
nnet: Too many weights?
I am using library(nnet) to train up an ANN with what I believe is a
moderately sized dataset, but R is complaining about too many weights:
---
> nn.1 <- nnet(t(data), targets, size = 4, rang = 0.1, decay = 5e-4, maxit =
200)
Error in nnet.default(t(data), targets, size = 4, rang = 0.1, decay = 5e-04,
:
Too many (1614) weights
> dim(targets)
[1] 146 2
> dim(data) ## Note
2007 Dec 14
2
train nnet
Hi R-helpers,
Can some one tell me how to train 'mynn' of this type?:
mynn <- nnet(y ~ x1 + ..+ x8, data = lgist, size = 2, rang = 0.1,
decay = 5e-4, maxit = 200)
I assume that this nn is untrained, and to train I have to split the
original data into train:test data set,
do leave-one-out refitting to refine the weights (please straighten
this up if I was wrong).
I just don't know
2013 Mar 06
1
CARET and NNET fail to train a model when the input is high dimensional
The following code fails to train a nnet model in a random dataset using
caret:
nR <- 700
nCol <- 2000
myCtrl <- trainControl(method="cv", number=3, preProcOptions=NULL,
classProbs = TRUE, summaryFunction = twoClassSummary)
trX <- data.frame(replicate(nR, rnorm(nCol)))
trY <- runif(1)*trX[,1]*trX[,2]^2+runif(1)*trX[,3]/trX[,4]
trY <-
2009 Feb 18
1
Training nnet in two ways, trying to understand the performance difference - with (i hope!) commented, minimal, self-contained, reproducible code
Dear all,
Objective: I am trying to learn about neural networks. I want to see
if i can train an artificial neural network model to discriminate
between spam and nonspam emails.
Problem: I created my own model (example 1 below) and got an error of
about 7.7%. I created the same model using the Rattle package (example
2 below, based on rattles log script) and got a much better error of
about
2009 May 29
1
final value of nnet with censored=TRUE for survival analysis
Hi there,
I´ve a question concerning the nnet package in the area of survival analysis: what is the final value, which is computed to fit the model with the following nnet-c
all:
net <- nnet(cat~x,
data=d,
size=2,
decay=0.1,
censored=TRUE,
maxit=20,
Wts=rep(0,22),
Hess=TRUE)
where cat is a matrix with a row for each record and
2009 Jun 07
1
Inf in nnet final value for validation data
Hi,
I use nnet for my classification problem and have a problem concerning the calculation of the final value for my validation data.(nnet only calculates the final value for the training data). I made my own final value formula (for the training data I get the same value as nnet):
# prob-matrix
pmatrix <- cat*fittedValues
tmp <- rowSums(pmatrix)
# -log likelihood
2006 Mar 10
1
need help in tune.nnet
Dear R people,
I want to use the tune.nnet function of e1071 package to tune nnet .
I am unable to understand the parameters of tune.nnet from the e1071 pdf
document.
I have performed nnet on a traindata and want to test it for class
prediction with a testdata.
I want to know the values of size,decay,range etc. parameters for which
the prediction of testdata is best.
Can anyone please tell me
2010 Oct 12
1
need help with nnet
HI, Dear R community,
My data set has 2409 variables, the last one is response variable. I have
used the nnet after feature selection and works. But this time, I am using
nnet to fit a model without feature selection. I got the following error
information:
> dim(train)
[1] 1827 2409
nnet.fit<-nnet(as.factor(out) ~ ., data=train, size=3, rang=0.3,
decay=5e-4, maxit=500) # model
2005 Oct 11
1
an error in my using of nnet
Hi, there:
I am trying nnet as followed:
> mg.nnet<-nnet(x=trn3[,r.v[1:100]], y=trn3[,209], size=5, decay = 5e-4,
maxit = 200)
# weights: 511
initial value 13822.108453
iter 10 value 7408.169201
iter 20 value 7362.201934
iter 30 value 7361.669408
iter 40 value 7361.294379
iter 50 value 7361.045190
final value 7361.038121
converged
Error in y - tmp : non-numeric argument to binary operator
2009 Jul 24
1
nnet library and FANN package'm
Hello !
I'd like to know to which of the FANN package network corresponds the R nnet
network ?
In more details, what is the R nnet activation function, what is the
training algorithm (rprop, quickprop, ...) ? Also, it seems that the R nnet
"decay" parameter in nnet corresponds to the "learning_rate" parameter in
FANN. Correct ?
Many thanks in advance !
Luc Moulinier
2009 Nov 02
1
modifying predict.nnet() to function with errorest()
Greetings,
I am having trouble calculating artificial neural network
misclassification errors using errorest() from the ipred package.
I have had no problems estimating the values with randomForest()
or svm(), but can't seem to get it to work with nnet(). I believe
this is due to the output of the predict.nnet() function within
cv.factor(). Below is a quick example of the problem I'm
2005 Jul 27
1
how to get actual value from predict in nnet?
Dear All,
After followed the help of nnet, I could get the networks trained and, excitedly, get the prediction for other samples. It is a two classes data set, I used "N" and "P" to label the two. My question is, how do I get the predicted numerical value for each sample? Not just give me the label(either "N" or "P")? Thanks!
FYI: The nnet example I
2003 Jul 16
1
Help on NNET
Hi, Dear all,
I am just starting using R in my work and got some trouble to figure out some of the errors. Can anybody help me?
The following is the script:
read.csv('pupil.txt',header=TRUE,sep='\t')->pupil
samp<-c(1:50, 112:162, 171:220, 228:278)
pupil.nn2 <- nnet(Type ~ ., data = pupil, subset = samp, size = 2, rang = 0.1, decay = 5e-4, maxit = 200)
2011 Jun 01
1
nnet inappropriate fit for class error
Hi,
I am trying to run a nnet algorithm but when I try to use the predict function with type='class', it gives the following error:
fit <- nnet(y~., size = 1, data = train.set, rang = 0.5, maxit=200, decay = 0)
predict<-predict(fit,test.set,type='class')
Error in predict.nnet(fit, test.set, type = "class") :
inappropriate fit for class
I couldn't figure
2004 Oct 18
1
nnet learning
Hi,
I am trying to make a neural network learning a "noisy sine wave".
Suppose I generate my data like so..
x <- seq(-2*pi, 2*pi, length=500)
y <- sin(x) + rnorm(500, sd=sqrt(0.075))
I then train the neural net on the first 400 points using
c <- nnet(as.matrix(x[1:400]),as.matrix(y[1:400]), size=3, maxit=10000,
abstol=0.075, decay=0.007)
Inspecting the fit of the training