Re: [R] Need help for SVM code for microarray classification

From: Steve Lianoglou <>
Date: Mon, 28 Jun 2010 23:09:40 -0400


On Mon, Jun 28, 2010 at 9:55 PM, Aadhithya <> wrote:
> Hi I am Aadhithya I am trying to write a code to classify microarray data
> (AML and ALL) using SVM in R
> my code goes like this :
> library(e1071)
> train<-read.table("Z:/Documents/train.txt",header=T);
> test<-read.table("Z:/Documents/test.txt",header=T);
> cl <- c(c(rep("ALL",10), rep("AML",10)));
> model<- svm(train,cl);
> pred <- predict(model,t(test));
> table(pred,t(cl));
> But I am not able to run it its giving me error . I will be really grateful
> if someone can help me.Thanks in advance

  1. Please give the error that it's giving you
  2. Are the number of features/columns in your training and testing matrices the same? Remember that like most other model-building-type functions in R, the rows of the data represent the different observations, and the columns of the data represent the different features/dimensions/predictor-variabls of each observation.
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info:

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 29 Jun 2010 - 03:11:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 Jun 2010 - 11:50:42 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive