0

I have some SVM models. E.g., moSvmN2C20F1. I tried

names(moSvmN2C20F1)
 [1] "call"         "type"         "kernel"       "cost"         "degree"       "gamma"        "coef0"       
 [8] "nu"           "epsilon"      "sparse"       "scaled"       "x.scale"      "y.scale"      "nclasses"    
[15] "levels"       "tot.nSV"      "nSV"          "labels"       "SV"           "index"        "rho"         
[22] "compprob"     "probA"        "probB"        "sigma"        "coefs"        "na.action"    "accuracies"  
[29] "tot.accuracy" "terms"   

every name but was not able to find the class weights.
Where can I find them? In the $call I have the calling variables:

moSvmN2C20F1$call
svm(formula = f1, data = aa, type = NULL, kernel = "radial", 
    gamma = teste$gama[l], cost = teste$cost[l], class.weights = c(`0` = (1 - 
    teste$c1[l]), `1` = teste$c1[l]), shrinking = F, cross = 10, 
    probability = F, fitted = F, scale = F)

Explaining better, moSvmN2C20F1$cost retrieves the cost parameter of the model. moSvmN2C20F1$gamma retrieves the gamma parameter of the model.
How can I retrieve the class.weigths parameter of the model? Where is this information? I expect something like:

moSvmN2C20F1$class.weights
 '0'    '1'
 0.4    0.6
xm1
  • 1,663
  • 1
  • 17
  • 28
  • All parameters of a function aren't required to be stored in the output value. I don't really understand what exactly you are trying to accomplish. When asking a question it's best to include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) that we can run. Be clear what you expect the output to be for that sample input. – MrFlick Dec 20 '16 at 19:43
  • Tks, @MrFlick. I edited the question to make it clearer. – xm1 Dec 20 '16 at 20:43

0 Answers0