It’s long time, find this way
snippets based on MLJ SVM tutorial
import MLJ: fit!,predict
using MLJ
using Plots
using PrettyPrinting
using Random
using KernelFunctions
#define kernelmethods
k1=PolynomialKernel(; degree=2, c=1)
k2 = SqExponentialKernel() ∘ ScaleTransform(1.5)
# make data
n1=n2=10
Random.seed!(3203)
X = randn(20, 2)
y=vcat(fill(-1, n1), fill(1, n2))
xs,ys=X[:,1],X[:,2]
#scatter(X[:,1],X[:,2],group=y,label=false)
X = MLJ.table(X)
y = categorical(y);
# work flow
@time SVC = @load SVC pkg=LIBSVM
svc_mdl = SVC(kernel=k2) #<=== kernel is here
svc = machine(svc_mdl, X, y)
fit!(svc);
ypred =predict(svc, X)
misclassification_rate(ypred, y)