Hi It clear that to do a classification with svm under 10-fold cross validation one uses svm(Xm, newlabs, type = "C-classification", kernel = "linear",cross = 10) What corresponds to the nnet? nnet(.....,cross=10)? Regards
there is no such thing in nnet(), if i understand correctly. how hard it is to code one though? On 7/23/07, S.O. Nyangoma <S.O.Nyangoma at amc.uva.nl> wrote:> Hi > It clear that to do a classification with svm under 10-fold cross > validation one uses > > svm(Xm, newlabs, type = "C-classification", kernel = "linear",cross > 10) > > What corresponds to the nnet? > nnet(.....,cross=10)? > > Regards > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- =============================="I am dying with the help of too many physicians." - Alexander the Great, on his deathbed ==============================WenSui Liu (http://spaces.msn.com/statcompute/blog)
Please read the documentation. nnet() is support software for a book, and that has explicit examples of this, which you will find in the scripts of the VR bundle (but I don't expect them to be comprehensible without the book). On Mon, 23 Jul 2007, S.O. Nyangoma wrote:> Hi > It clear that to do a classification with svm under 10-fold cross > validation one uses > > svm(Xm, newlabs, type = "C-classification", kernel = "linear",cross > 10) > > What corresponds to the nnet? > nnet(.....,cross=10)? > > Regards > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
do it manually. divide your dataset into 10 parts then train and test accordingly. Saeed S.O. Nyangoma wrote:> Hi > It clear that to do a classification with svm under 10-fold cross > validation one uses > > svm(Xm, newlabs, type = "C-classification", kernel = "linear",cross = > 10) > > What corresponds to the nnet? > nnet(.....,cross=10)? > > Regards > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Hi all,
there is tune() in the e1071 package for doing this in general, and,
among others, a tune.nnet() wrapper (see ?tune):
> tmodel = tune.nnet(Species ~ ., data = iris, size = 1:5)
> summary(tmodel)
Parameter tuning of `nnet':
- sampling method: 10-fold cross validation
- best parameters:
size
1
- best performance: 0.01333333
- Detailed performance results:
size error dispersion
1 1 0.01333333 0.02810913
2 2 0.02666667 0.04661373
3 3 0.02666667 0.04661373
4 4 0.02000000 0.04499657
5 5 0.02666667 0.04661373
> plot(tmodel)
> tmodel$best.model
a 4-1-3 network with 11 weights
inputs: Sepal.Length Sepal.Width Petal.Length Petal.Width
output(s): Species
options were - softmax modelling
etc.
Best
David
On 7/23/07, S.O. Nyangoma <S.O.Nyangoma at amc.uva.nl> wrote:
> > Hi
> > It clear that to do a classification with svm under 10-fold cross
> > validation one uses
> >
> > svm(Xm, newlabs, type = "C-classification", kernel =
"linear",cross > > 10)
> >
> > What corresponds to the nnet?
> > nnet(.....,cross=10)?