Re: [R] setting weights for such a two-class problem in nnet andsvm

From: Baoqiang Cao <caobg_at_email.uc.edu>
Date: Sat 23 Jul 2005 - 03:18:01 EST

>On Fri, 22 Jul 2005, Baoqiang Cao wrote:
>
>> Dear All,
>>
>> I have such a two-class problem, one class is very large(~98% of total),
>> and the other is just 2%. According to manual of nnet, I need setup
>> "weights", so I intend to set 1 for class one, 49 for class 2. How do I
>> do that? Just weights=49?
>
>I do not know what you mean by `manual of nnet', but no, not that since
>the help page says
>
> weights: (case) weights for each example - if missing defaults to 1.
>
Thanks! I should have said "according to the help page"...
>More likely you want ifelse(class==1, 1/49, 1).
>
>However, there is more to it than that, and do please read the reference
>books on the help page.
Unfortunately, the two refered books(all by you) were all borrowed by someone else, nothing left in the library. Beside waiting longer or buy one, would you breifly mention some of what you think should be aware of? I'm hoping to find a optimal feature space with better predictions. Thanks.

Best,
 Baoqiang Cao   

>
>
>--
>Brian D. Ripley, ripley@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@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 Received on Sat Jul 23 03:21:41 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:57 EST