Re: [R] Softmax in nnet

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri, 15 Feb 2008 14:48:40 +0000 (GMT)

Looks like you meant to use 'TRUE' not 'T'. The latter is probably a variable you defined of length > 1.

Double-posting at least halves your chances of getting help, so please stop doing it.

On Fri, 15 Feb 2008, G Ilhamto wrote:

> Hi R help,
>
> I run my data in nnet with skip layer, factor response (with 0 & 1
> values) and explicitly put softmax=T to compare the result of the
> default nnet with no softmax specification. I assume this should give
> me the same result. I got the result the default one, but not the
> softmax version and I got the error message that I did not quite
> understand.
>
> test6.nn.skipT.softm.Yfac <- nnet(Yfac~ X1 +.. +X8, skip=T, size=0,
> softmax=T, data = train.set)
>
> Error in nnet.default(x, y, w, entropy = TRUE, ...) : no weights to fit
>
> In addition: Warning messages:
> 1: In if (softmax) { : the condition has length > 1 and only the
> first element will be used
> 2: In if (skip) net <- add.net(net, seq(1, net$n[1]), seq(1 + net$n[1] + :
> the condition has length > 1 and only the first element will be used
>
> When I specify the weights (0.1 just for a try)
> test6.nn.skipT.softm.Yfac <- nnet(Yfac~ X1 +.. +X8, skip=T, size=0,
> weights= 0.1, softmax=T, data = train.set)
>
> I got another error message:
> Error in model.frame.default(formula = Yfac ~ HusYEduc + AgeRespd +
> muslimat + :
> variable lengths differ (found for '(weights)')
> -----------------
>
> Q: Does softmax apply to two-category response?
> What is softmax require?
>
> Thank you,
> Ilham
>
> ______________________________________________
> R-help_at_r-project.org 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

______________________________________________
R-help_at_r-project.org 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.
Received on Fri 15 Feb 2008 - 15:23:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 15 Feb 2008 - 15:30:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive