[R] Help required

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue Apr 12 14:46:16 CEST 2011


Hi Sadaf,

Out of curiosity, what sorts of things have you tried to fix this?

For example, after playing around with this a bit, if I remove your
"eps" parameter from your `ranges` list, it works.

Perhaps you should try tweaking the values you pick for your
parameters. You don't even have to put it in the `tune` function to
get an idea of the ranges you should use:

R> m=svm(Rexp ~ ., data=retrain, epsilon=10)Error in predict.svm(ret,
xhold, decision.values = TRUE) :
  Model is empty!

See? I think if you do a bit of exploration of the parameter space,
you'll get it to work.

-steve

On Mon, Apr 11, 2011 at 10:50 PM, Sadaf Zaidi <s.zaidi.ke at amu.ac.in> wrote:
> Dear Sir,
> Thanks for ur prompt reply. The details are:
> 1) I had an excel data file. I converted it into .csv file and loaded it into R.
> 2) then I invoked e-1071 package and used the following code to tune the svm.
>> retune<-tune(svm, Rexp~.,data=retrain, ranges=list(gamma=c(2^-10,2^-8,2^-6,2^-4, 2^-2,
> 2^0, 2^1, 2^2, 2^3), cost=c(0.1,0.4,0.6,0.8,1.0,1.2,1.4),
> eps=10^(2:1)),tunecontrol=tune.control(sampling="cross")).
> 3) I got the following error message.
> Error in predict.svm(ret, xhold, decision.values = TRUE) :
>  Model is empty!
> 4) 10 random data as per your instructions are:
> structure(list(Peb = c(225.0282, 514.4835, 66.6346, 221.4287,
> 366.8782, 429.7749, 161.9826, 124.2772, 98.63578, 160.9544),
>   Ksub = c(7.892368, 21.07559, 66.61676, 43.01224, 113.7249,
>   2.642293, 4.475745, 113.4638, 43.69712, 46.29462), Sub = c(50,
>   30, 98.96, 73.96, 77.43, 30, 100, 99.65, 100, 96.88), Xtt = c(6.632812,
>   0.751595, 5.664743, 1.630639, 1.49907, 26.39829, 11.07653,
>   3.319892, 8.356013, 4.484025), Rexp = c(78433.04, 14106,
>   4670.345, 9326.914, 3519.494, 573554.6, 27154.07, 3695.473,
>   14582.2, 13297.71)), .Names = c("Peb", "Ksub", "Sub", "Xtt",
> "Rexp"), row.names = c(300L, 196L, 70L, 150L, 31L, 319L, 251L,
> 40L, 200L, 191L), class = "data.frame")
>
> Please help.
>
> SADAF ZAIDI
>
> Department of
> Aligarh Muslim University
> Aligarh 202002.
>
>
> Department of
> Aligarh Muslim University
> Aligarh 202002.
>
>



-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list