Thin S3 wrapper that dispatches to plot_boundary or
plot_surface depending on plot.type.
An svmodt_node returned by svm_split.
Ignored; present only to satisfy the graphics::plot
generic signature.
Currently unused.
The original training data frame (required).
Character string naming the response column (required).
One of "surface" (default) or "boundary".
Length-2 character vector of axis features
("surface" only; default uses root node features).
Maximum depth to visualize
("boundary" only; default NULL = full tree).
Logical; show per-node accuracy
("boundary" only; default TRUE).
Grid resolution per axis.
Default 100 for "boundary", 200 for
"surface".
"boundary": invisibly returns the list from
plot_boundary.
"surface": invisibly returns the ggplot2 object from
plot_surface.
# \donttest{
tree <- svm_split(wdbc, response = "diagnosis", max_depth = 3)
# All-node boundary panels - prints first, returns list
viz <- plot(tree,
data = wdbc, response = "diagnosis",
plot.type = "boundary"
)
#> $depth_1_Root
#>
#> $depth_2_Root_L
#>
viz$plots[[2]] # second node
# Global decision surface
plot(tree,
data = wdbc, response = "diagnosis",
plot.type = "surface"
)
# Surface with explicit feature axes
plot(tree,
data = wdbc, response = "diagnosis",
plot.type = "surface",
features = c("radius_mean", "concavity_mean")
)
# }