[R] erro in SVM (packsge "e1071")

David Meyer david.meyer at wu-wien.ac.at
Mon Dec 20 22:41:32 CET 2004


So the error occurs during a call to model.matrix() from svm() because
of the polynomial contrasts--do you get the same error using, e.g.,
lm()?

best,
David

> The way I call SVM is:
> 
> i <- (-2)
> j <- 4
> learner='svm'
> learner.pars=list(Duracao ~ ., data=orig.data,
>    scale=c(FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE,
>     FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
>     FALSE, FALSE, FALSE),
>    type='nu-regression', kernel='linear',
>    cost=2^(2*i), nu=j/10)
> learner.pars$data <- orig.data[begin.test.pos:(test.pos-1),]
> 
> model <- do.call(learner,learner.pars)
> 
> The variables begin.test.pos and test.pos are windexes for orig.data
> and are working well. in this case begin.test.pos = 1 and test.pos =
> 875.
> 
> orig.data is a data.frame where the second, third and seventh
> parameters are numeric. The first parameter  is a date and all the
> others are factors (some of them ordered). The ordered factors are:
> Dia Semana (week day), DiaAno (day of the year), DiaMes (day of the
> month), SemanaAno (week of the year) and SemanaMes (week of the
> month). The first two lines of the orig.data data.frame are:
>          Data       InicioViagem Duracao     DiaSemana  TipoDia
>          EpocaEscolar 
> DiasDesdeUltPagamento DiaAno DiaMes FluxoEntrada FluxoSaida
> 13 2004-01-01        25056    3220        quinta-feira   feriado 
> normal                     9                        1             1 
> normal           fsp4
> 9  2004-01-01        28554    2866         quinta-feira   feriado 
> normal                     9                        1             1 
> normal           fsp4
>             Modelo                  Motorista SemanaAno SemanaMes
>             Servico
> 13    Mercedes_O530_N     10701         1             1 
> 10597
> 9      Mercedes_O530_N     11292         1             1 
> 10597
> 
> I am using sliding window with 30 days (around 900 records) for
> training. The error is in the svm function. May be because SVM uses
> other functions, but it happens when I run svm.
> 
> Thanks a lot for the help
> 
> Joao
> _______________________________________________
> FEUP - Engineering Faculty, Porto University
> Engineering and Industrial Management group
> Tel.: +351 22 508 1639
> Fax: +351 22 508 1538
> 
> ----- Original Message ----- 
> From: "David Meyer" <david.meyer at wu-wien.ac.at>
> To: <jmoreira at fe.up.pt>
> Cc: <r-help at stat.math.ethz.ch>
> Sent: Sunday, December 19, 2004 1:23 PM
> Subject: Re: [R] erro in SVM (packsge "e1071")
> 
> 
> > Joao:
> >
> > The reported error message is not from e1071.
> > How *exactly* did you call svm()?
> >
> > As to the documentation of the nu parameter: yes, this is an
> > omission, of course, nu is used in nu-regression as well; thanks for
> > pointing this out.
> >
> > best,
> > David
> >
> > ---------
> >
> > Hello,
> >
> > I am using SVM under e1071 package for nu-regression with 18
> > parameters. The
> > variables are ordered factors, factors, date or numeric datatypes. I
> > use the
> > linear kernel.
> > It gives the following error that I cannot solve. I tryed debug,
> > browser and
> > all that stuff, but no way.
> > The error is:
> >
> > Error in get(ctr, mode = "function", envir =
> > parent.frame())(levels(x),:
> >        Orthogonal polynomials cannot be represented accurately
> >        enough
> > for 236
> > degrees of freedom
> >
> > I use the nu parameter. However, reading ?svm help it says
> > "parameter needed
> > for 'nu-classification' and 'one-classification'". Does not say
> > anything about
> > nu-regression. It is an omission in the ?svm help page? Or am I
> > notundestanding something?
> >
> > I believe it has something to do with the calculus of the
> > eigenvalues. Anyway
> > how can I overpass this problem? Increasing the training data (is
> > around 900
> > records)?
> >
> > Thanks for any help
> >
> > Joao
> >
> >
> >
> >
> > -- 
> > Dr. David Meyer
> > Department of Information Systems
> >
> > Vienna University of Economics and Business Administration
> > Augasse 2-6, A-1090 Wien, Austria, Europe
> > Fax: +43-1-313 36x746
> > Tel: +43-1-313 36x4393
> > HP:  http://wi.wu-wien.ac.at/~meyer/
> > 
> 
> 


-- 
Dr. David Meyer
Department of Information Systems

Vienna University of Economics and Business Administration
Augasse 2-6, A-1090 Wien, Austria, Europe
Fax: +43-1-313 36x746 
Tel: +43-1-313 36x4393
HP:  http://wi.wu-wien.ac.at/~meyer/




More information about the R-help mailing list