Entering edit mode
Hi.
I am trying to learn MLInterfaces to apply some Machine Learning
Techniques to expression data. For now, it has been a pretty calm
trip, but I have just arrived to a point where I am totally clueless.
I have a small ExpressionSet, which I have generated as a subset of a
bigger one:
> eset
ExpressionSet (storageMode: lockedEnvironment)
assayData: 10 features, 55 samples
element names: exprs
protocolData: none
phenoData
sampleNames: GSM671268 GSM671269 ... GSM671347 (55 total)
varLabels: title geo_accession ... data_row_count (36 total)
varMetadata: labelDescription
featureData
featureNames: 1007_s_at 1053_at ... 160020_at (10 total)
fvarLabels: ID GB_ACC ... Gene Ontology Molecular Function (16
total)
fvarMetadata: Column Description labelDescription
experimentData: use 'experimentData(object)'
Annotation: GPL96
As you can see, it is indeed small. It means nothing, but I just
wanted something small enough to play with the interfaces in a
reasonable amount of time. I just wanted to learn a linear SVM on it,
but when I do the following...
> X <- MLearn(source_name_ch1 ~ ., eset, svmI, xvalSpec('NOTEST'))
â¦I get this error message (I have the Spanish version, translating
it below)
Error en matrix(ret$dec, nrow = nrow(newdata), byrow = TRUE, dimnames
= list(rowns, :
extensión negativa para la matriz
Error durante el wrapup:
(Error in matrix [â¦]
Error during wrapup)
If I execute the following, without using xvalSpec()â¦
> X <- MLearn(source_name_ch1 ~ ., eset, svmI, 1:55)
â¦I get the same result (fail). However, if I restrict the training
indices, and execute as followsâ¦
> X <- MLearn(source_name_ch1 ~ ., eset, svmI, 1:54)
â¦then it works as smoothly as expected.
In order to implement a version of SVM-RFE, I need to train the SVM on
all the training data available, which is something I have done before
(with SVMLight on a UNIX machine, or with LibSVM from C++ code, long,
long time before I discovered the wonderful world of R and BioC).
Output of traceback(), after the error, looks like this:
> traceback()
12: matrix(ret$dec, nrow = nrow(newdata), byrow = TRUE, dimnames =
list(rowns,
colns))
11: napredict.default(act, matrix(ret$dec, nrow = nrow(newdata),
byrow = TRUE, dimnames = list(rowns, colns)))
10: napredict(act, matrix(ret$dec, nrow = nrow(newdata), byrow = TRUE,
dimnames = list(rowns, colns)))
9: predict.svm(obj, teData, decision.values = TRUE, probability =
TRUE)
8: predict(obj, teData, decision.values = TRUE, probability = TRUE)
7: .method@converter(ans, data, trainInd)
6: MLearn(formula, data, .method, 1:N, ...)
5: MLearn(formula, data, .method, 1:N, ...)
4: MLearn(formula, data, .method, trainInd, ...)
3: MLearn(formula, data, .method, trainInd, ...)
2: MLearn(source_name_ch1 ~ ., eset, svmI, xvalSpec("NOTEST"), kernel
= "linear")
1: MLearn(source_name_ch1 ~ ., eset, svmI, xvalSpec("NOTEST"), kernel
= "linear")
â¦and this is my sessionInfo:
> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] C/en_US.UTF-8/C/C/C/C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] MLInterfaces_1.36.0 sfsmisc_1.0-20 cluster_1.14.2
annotate_1.34.0
[5] AnnotationDbi_1.18.0 rda_1.0.2 rpart_3.1-52
MASS_7.3-18
[9] multtest_2.12.0 genefilter_1.38.0 GEOquery_2.23.2
Biobase_2.16.0
[13] BiocGenerics_0.2.0
loaded via a namespace (and not attached):
[1] DBI_0.2-5 IRanges_1.14.3 Matrix_1.0-6 RCurl_1.91-1
RSQLite_0.11.1
[6] XML_3.9-4 class_7.3-3 e1071_1.6 gdata_2.8.2
grid_2.15.0
[11] gtools_2.6.2 lattice_0.20-6 mboost_2.1-2 nnet_7.3-1
splines_2.15.0
[16] stats4_2.15.0 survival_2.36-14 tools_2.15.0 xtable_1.7-0
Does anybody know why the call to MLearn fails? By the way, if I call
directly to the sum() function in e1071 package, it works:
> svm(t(exprs(eset)), eset$source_name_ch1, kernel='linear',
subset=1:55)
Call:
svm.default(x = t(exprs(eset)), y = eset$source_name_ch1, kernel =
"linear", subset = 1:55)
Parameters:
SVM-Type: C-classification
SVM-Kernel: linear
cost: 1
gamma: 0.1
Number of Support Vectors: 10
..so I guess it might be a MLInterfaces issue. What do you think?
Regards,
Gustavo
---------------------------
Enviado con Sparrow (http://www.sparrowmailapp.com/?sig)
[[alternative HTML version deleted]]