Hi! I am using R 1.8.1 and the svm of the e1071 package for classification. The problem is that I have unbalanced classes e.g. the first one is much bigger than the second one and therfore the svm is biased to the first class. If I manually adjust the class size the bias disappears. The question is then how to include this unequal class distribution to the svm (e.g. via wheights or costs)? Yours, Frank -- Frank G. Zoellner AG Angewandte Informatik Technische Fakult"at Universit"at Bielefeld phone: +49(0)521-106-2951 fax: +49(0)521-106-2992 email: fzoellne at techfak.uni-bielefeld.de
Hi, SVM have got the option class.weights to put the apriori-distribution for your target variable. To oversample, or undersample a specific class you have imho write a own function!? Perhaps it helps ,christian Am Dienstag, 9. M?rz 2004 11:29 schrieb Frank Gerrit Zoellner:> Hi! > > I am using R 1.8.1 and the svm of the e1071 package for classification. > The problem is that I have unbalanced classes e.g. the first one is much > bigger than the second one and therfore the svm is biased to the first > class. If I manually adjust the class size the bias disappears. > The question is then how to include this unequal class distribution to the > svm (e.g. via wheights or costs)? > > Yours, > Frank
You might consider using the `weight' argument of svm(). Best, David. Hi! I am using R 1.8.1 and the svm of the e1071 package for classification. The problem is that I have unbalanced classes e.g. the first one is much bigger than the second one and therfore the svm is biased to the first class. If I manually adjust the class size the bias disappears. The question is then how to include this unequal class distribution to the svm (e.g. via wheights or costs)? Yours, Frank -- Frank G. Zoellner AG Angewandte Informatik Technische Fakult"at Universit"at Bielefeld phone: +49(0)521-106-2951 fax: +49(0)521-106-2992 email: fzoellne at techfak.uni-bielefeld.de