I want to perform feature selection on via svmRFE using the e1071 library. However, I keep getting a "Model is empty" error. Someone else reported the same issue (Model is empty, SVM in e1071 package) and it was suggested that the error occured because all the samples are the same. But my label ifelse function classified the labels as Ctl and Glioma. So why am I still getting an error when the labels are different? Of note, there are many types of gliomas (e.g., astrocytoma, glioblastoma, oligodendroglioma. That's why the astrocytoma samples are labelled as "gliomas". I wonder if I label the glioma samples as astrocytoma, glioblastoma, oligodendroglioma will it resolve the issue? If so, how should I amend the ifelse function?
library(e1071)
source('msvmRFE.R')
# Feature Selection via svmRFE which utilizes the library e1071
label <- ifelse(grepl("^non-tumor", colnames(top.genes.matrix)), "Ctl", "Glioma")
t.dat <- t(top.genes.matrix)
svm.df <- data.frame(label, t.dat)
ranked.list <- svmRFE(svm.df, k=10, halve.above=100)
Scaling data...Done! |
| 0% Error in predict.svm(ret, xhold, decision.values = TRUE) :
Model is empty!
> dput(svm.df[1:40,1:5])
structure(list(label = c("Ctl", "Ctl", "Ctl", "Ctl", "Ctl", "Ctl",
"Ctl", "Ctl", "Ctl", "Ctl", "Ctl", "Ctl", "Ctl", "Ctl", "Ctl",
"Ctl", "Ctl", "Ctl", "Ctl", "Ctl", "Ctl", "Ctl", "Ctl", "Glioma",
"Glioma", "Glioma", "Glioma", "Glioma", "Glioma", "Glioma", "Glioma",
"Glioma", "Glioma", "Glioma", "Glioma", "Glioma", "Glioma", "Glioma",
"Glioma", "Glioma"), X219752_at = c(9.7453140114e+288, Inf, Inf,
Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf,
Inf, Inf, Inf, Inf, Inf, Inf, Inf, 6.99920231930564e+100, 4.425834769824e+194,
4.08905013671742e+108, 9.55556376729943e+116, Inf, 3.32525456071435e+76,
43317043134214.2, 1.89838475977581e+122, 8.13966605576154e+236,
5.14826118888901e+29, 1.83048235798075e+170, 7.06003489677054e+218,
6.10434989056862e+109, 9.14639898838155e+128, 3.67201016264943e+147,
1.0234671438433e+76, 1.60610184618251e+133), X240512_x_at = c(5.29888441356601e+246,
3.67009936848685e+220, 4.2899121663437e+41, 8.40516277768061e+129,
5.18689446110124e+179, 1.25493857651029e+245, 1.54683122103543e+213,
1.1835373727435e+71, 7.20674433073256e+130, Inf, 9.09145681001345e+174,
4.71809784114593e+281, 3.02115472858483e+210, 1.58083541806485e+93,
2.15709053730637e+182, 4.12730102449738e+267, 4.13431590005232e+162,
4.22577864400639e+156, 2.77631637353339e+211, 2.24976436669632e+275,
4.07675022923096e+131, 3.22445392538858e+265, 2.9272477355908e+244,
2.71228730528275e+21, 5.12336586495199e+43, 2581896.96873512,
2.4150058542247e+56, 2.33290131037584e+113, 2.03569771781862e+49,
500918273.092454, 2.36707474548701e+71, 5.56496598258817e+33,
1.46591111397764e+25, 1.57690081553943e+43, 7.58356495879075e+40,
7.14934449505462e+53, 23770141341076888, 3.43823263053306e+51,
4194304, 268928450112610624), X213938_at = c(Inf, Inf, Inf, Inf,
Inf, Inf, Inf, Inf, 2.83773633266271e+205, Inf, Inf, Inf, Inf,
4.65418972382077e+63, Inf, Inf, Inf, Inf, Inf, Inf, Inf, Inf,
Inf, 1.19742579035929e+166, 3.84837811541047e+226, 3.64037039798294e+29,
1.2741585825629e+244, Inf, 3.68066927898873e+83, 7.97178549603637e+96,
8.39526999277756e+161, Inf, 1.03032912652388e+71, Inf, 7.87737711641644e+302,
8.51824785431991e+119, 5.67174408629459e+164, 3.84584987101745e+185,
1.4811650310138e+38, 8.24263301219105e+71), X239767_at = c(Inf,
Inf, 1.92645647596287e+194, Inf, Inf, Inf, Inf, Inf, Inf, Inf,
Inf, Inf, Inf, 1.89267439767754e+145, Inf, Inf, Inf, Inf, Inf,
Inf, Inf, Inf, Inf, 3.50142318592413e+27, 2.98963244205335e+83,
33554432, 1.31003794411943e+78, Inf, 2.66822971269922e+54, 67108864,
2.07311137862063e+25, 2.08866829643771e+175, 1.14076605992587e+306,
4.08692232857234e+181, 8.79151582267502e+85, 691802.163523298,
2.36551966350876e+30, 3.85692594413134e+48, 5.60227709747861e+28,
3.16912650057057e+29)), row.names = c("non-tumor_GSM97800", "non-tumor_GSM97803",
"non-tumor_GSM97804", "non-tumor_GSM97805", "non-tumor_GSM97807",
"non-tumor_GSM97809", "non-tumor_GSM97811", "non-tumor_GSM97812",
"non-tumor_GSM97816", "non-tumor_GSM97817", "non-tumor_GSM97820",
"non-tumor_GSM97825", "non-tumor_GSM97827", "non-tumor_GSM97828",
"non-tumor_GSM97833", "non-tumor_GSM97834", "non-tumor_GSM97840",
"non-tumor_GSM97846", "non-tumor_GSM97848", "non-tumor_GSM97849",
"non-tumor_GSM97850", "non-tumor_GSM97853", "non-tumor_GSM97855",
"astrocytomas_II_GSM97878", "astrocytomas_II_GSM97913", "astrocytomas_II_GSM97932",
"astrocytomas_II_GSM97939", "astrocytomas_II_GSM97951", "astrocytomas_II_GSM97957",
"astrocytomas_II_GSM97972", "astrocytomas_III_GSM97793", "astrocytomas_III_GSM97795",
"astrocytomas_III_GSM97802", "astrocytomas_III_GSM97810", "astrocytomas_III_GSM97815",
"astrocytomas_III_GSM97837", "astrocytomas_III_GSM97843", "astrocytomas_III_GSM97890",
"astrocytomas_III_GSM97899", "astrocytomas_III_GSM97910"), class = "data.frame")
Aucun commentaire:
Enregistrer un commentaire