R/svmodt_visualizer.R
plot_boundary.RdTraverses the tree recursively and produces one plot per internal node, showing the SVM hyperplane for that node's binary split, the background region colouring, and the actual data points (coloured by true class). Each node receives only the subset of data that reaches it during training.
plot_boundary(
tree,
data,
response_col = NULL,
max_depth = NULL,
check_accuracy = TRUE,
resolution = 100
)An svmodt_node object returned by svm_split.
The original training data frame.
Character string naming the response column in
data. Auto-detected when NULL (first factor/character
column not used as a predictor).
Maximum tree depth to visualize. NULL (default)
shows all nodes.
Logical; if TRUE (default), compute and
display training accuracy at each node.
Integer; grid resolution per axis (default 100).
Increase for smoother boundaries at the cost of speed.
Invisibly returns a list with four elements:
plotsNamed list of ggplot2 objects, one per node.
Names encode depth and path, e.g. "depth_1_Root",
"depth_2_Root_L".
grid_dataNamed list of data frames (full expanded grid used for each node's contour calculation).
accuracy_infoNamed list of per-node metadata: depth, path, sample count, accuracy, features, whether the boundary was visible, and the pad factor that was needed.
response_colThe response column name used.