Error in .local(x, ...) : plot function only supports binary classification

15 views Asked by At

I would like to draw an SVM plot for three targets. However, as in the title, an error occurs, stating that only binary classification is possible. Which part of the code below should I modify?

library(e1071)
library(caret)
library(kernlab)

a<-read.csv(file="Data78.csv", header=TRUE)

a$target<-as.factor(a$target)
scaling<-c("X9th","X6th")
a[,scaling]<-lapply(a[,scaling],scale)

set.seed(2023)
segmen<-sort(sample(nrow(a),nrow(a)*0.6))
train<-a[segmen,]
test<-a[segmen,]

linear<-ksvm(target!., data=train, kernel="polydot",kpar=list(degree=3),C=1000)
plot(linear, data=train)
            

I wanted to draw an SVM plot for three targets. But, an error message appeared saying that only binary classification was possible. Thank you for your reply in advance.

0

There are 0 answers