Dear all, I would like to use KSVM with weighted classes. Thus I created a named vector as follows:
> VECT = c(1.0, 0.5, 0.7) > names(VECT) = c("negative", "positive", "uncertain") > VECT negative positive uncertain 1.0 0.5 0.7 The data TRAIN contains the following levels: > unique(TRAIN$z) [1] negative positive uncertain Levels: negative positive uncertain Actually, I copied and pasted these values to create VECT. Then I ran the model as follows: > mod = ksvm(z ~ a+b, data = TRAIN, + type = "C-svc", + kernel = "rbfdot", + kpar = "automatic", + C = 1, + prob.model = TRUE, + class.weights = VECT + ) Error in .local(x, ...) : At least one level name is missing or misspelled. > Since there are only values for the variable z and I pasted them into VECT, how can this be a misspelling error? Would you have any tips? Thank you, Luigi ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.