morph_boundary: Animate a Decision Boundary Across a Hyperparameter Range

View source: R/morph.R

morph_boundaryR Documentation

Animate a Decision Boundary Across a Hyperparameter Range

Description

Refits a model over a sequence of hyperparameter values and returns a gganimate object showing the boundary change.

Usage

morph_boundary(
  x,
  y,
  param = c("gamma", "cost", "c1"),
  range,
  model = c("tsvm", "svms"),
  n = 30,
  ...
)

Arguments

x

Numeric two-column matrix or data frame.

y

Two-class response.

param

Hyperparameter to vary.

range

Numeric length-two range for the hyperparameter.

model

Model family: "tsvm" or "svms".

n

Number of frames.

...

Additional arguments passed to the model fit function.

Value

A gganim object.

Examples


if (interactive()) {
  dat <- gen_moons(40)
  morph_boundary(dat$x, dat$y, param = "gamma", range = c(0.5, 2), n = 4)
}


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