Learn R Programming

twinsvm (version 0.0.1)

morph_boundary: 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,
  ...
)

Value

A gganim object.

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.

Examples

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

Run the code above in your browser using DataLab