Hi, I am trying to use svm for regression data. this is how my data looks like:>dataTrainx y z 1 4 6 2 5 4 3 7 5>classTraina 2 3 4>dataTestx y z 1 7 2 2 8 3>classTesta 3 4 5 building the model model<-svm(dataTrain,classTrain,type="nu-regression") pred <- predict(model, dataTest)> pred1 2 3.008842 3.120078 I don't understand what the above value means.i need the results similar to classTest. Thanks, Joji. [[alternative HTML version deleted]]
Hi, I am having trouble with svm regression.it is not giving the right results. example> model <- svm(dataTrain,classTrain,type="eps-regression") > predict(model, dataTest)36 37 38 39 40 41 42 -13.838257 -1.475401 10.502739 -3.047656 -8.713697 3.812873 1.741999 43 44 45 46 47 48 49 -6.034361 -13.469742 7.628642 -22.197060 -3.417444 -8.536890 -11.876133 50 -5.877457 My dataSet has 50 columns and 19 rows my classSet has 50 columns and 1 row My dataTrain has 35(1:35) columns and 19 rows My classTrain has 35(1:35) columns and 1 row My dataTest has 15(36:50) columns and 19 rows My classTest has 15(36:50) columns and 1 row My results should be as follows: [1] -25.70 30.30 -58.50 -1.12 7.62 -16.10 -48.50 21.10 12.60 -43.00 [11] -47.30 -47.90 -38.40 -21.30 22.40 But instead i get the wrong values.can anyone help me with it. Thanks, Joji. [[alternative HTML version deleted]]
On 18.02.2010 17:54, madhu sankar wrote:> Hi, > > I am trying to use svm for regression data. > > this is how my data looks like: > >> dataTrain > > x y z > 1 4 6 > 2 5 4 > 3 7 5 > >> classTrain > > a > 2 > 3 > 4 > >> dataTest > > x y z > 1 7 2 > 2 8 3 > >> classTest > > a > 3 > 4 > 5 > > > building the model > > model<-svm(dataTrain,classTrain,type="nu-regression") > pred<- predict(model, dataTest) > >> pred > 1 2 > 3.008842 3.120078 > > I don't understand what the above value means.i need the results similar to > classTest.They are similar, aren't they? You talk about svm *regression* rather than classification and call your object "class....." which makes me worry you failed to understand some basics of the method. Uwe Ligges> > Thanks, > Joji. > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
On 18.02.2010 19:43, madhu sankar wrote:> Hi, > > I am having trouble with svm regression.it is not giving the right results. > > example > >> model<- svm(dataTrain,classTrain,type="eps-regression") >> predict(model, dataTest) > 36 37 38 39 40 41 > 42 > -13.838257 -1.475401 10.502739 -3.047656 -8.713697 3.812873 > 1.741999 > 43 44 45 46 47 48 > 49 > -6.034361 -13.469742 7.628642 -22.197060 -3.417444 -8.536890 > -11.876133 > 50 > -5.877457 > > > My dataSet has 50 columns and 19 rows > my classSet has 50 columns and 1 row > > My dataTrain has 35(1:35) columns and 19 rows > My classTrain has 35(1:35) columns and 1 row > > My dataTest has 15(36:50) columns and 19 rows > My classTest has 15(36:50) columns and 1 rowSame problems as in my last mail: I fear you are mixing up several things: regression vs. classification, rows vs. columns....> My results should be as follows: > > [1] -25.70 30.30 -58.50 -1.12 7.62 -16.10 -48.50 21.10 12.60 -43.00 > [11] -47.30 -47.90 -38.40 -21.30 22.40Why do you know? Uwe Ligges> But instead i get the wrong values.can anyone help me with it. > > Thanks, > Joji. > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.