compare_methods: Compare Twin-SVM and Standard SVM Boundaries

View source: R/compare.R

compare_methodsR Documentation

Compare Twin-SVM and Standard SVM Boundaries

Description

Fits least-squares twin SVM, original QP twin SVM, and the standard C-SVC SVM baseline on the same two-dimensional data, then plots the three decision boundaries side by side.

Usage

compare_methods(x, y, kernel = "rbf", gamma = 0.5, c1 = 1, c2 = 1, cost = 1)

Arguments

x

Numeric two-column matrix or data frame.

y

Two-class response.

kernel

Kernel name: "linear", "rbf", or "poly".

gamma

Kernel scale.

c1, c2

Positive twin-SVM regularization parameters.

cost

Positive C-SVC cost parameter.

Value

A faceted ggplot object.

See Also

Other visualization: kernel_lift(), lift_plot(), lift_plotly()

Examples

set.seed(30)
dat <- gen_moons(50, noise = 0.1)
compare_methods(dat$x, dat$y, gamma = 1, c1 = 0.2, c2 = 0.2, cost = 1)

twinsvm documentation built on June 10, 2026, 1:06 a.m.