[R] svm models in a loop

Alexy Khrabrov deliverable at gmail.com
Sun Oct 12 06:59:06 CEST 2008


I want to train svm models on increasingly large training data subsets  
of some zrr as follows:

 > m <- sapply(1:5,function(i)  
svm(person_oid~.,data=zrr[1:100*i,]))    # (*)

However, when I inspect m[1], it literally shows

 > m[1]
[[1]]
svm(formula = person_oid ~ ., data = zrr[1:N, ])

-- as opposed to

 > m1 <- svm(person_oid~.,data=zrr[1:100,])
 > m1
 > m1

Call:
svm(formula = person_oid ~ ., data = zrr[1:100, ])
... -- actual parameters

How do I force actual model evaluation in (*) ?

Cheers,
Alexy



More information about the R-help mailing list