View source: R/mplot3_decision.R
mplot3_decision | R Documentation |
mplot3
: Decision boundariesPlot classification decision boundaries of rtemis models
mplot3_decision(
rtmod,
data,
vars = c(1, 2),
dots.per.axis = 100,
bg.cex = 0.5,
bg.alpha = 0.4,
bg.pch = 15,
par.reset = TRUE,
theme = "white",
col = c("#18A3AC", "#F48024"),
contour.col = "black",
contour.lwd = 0.1,
point.pch = c(3, 4),
point.alpha = 1
)
rtmod |
rtemics trained model |
data |
Matrix / data frame of features; last column is class |
vars |
Integer vector, length 2: Index of features (columns of |
dots.per.axis |
Integer: Draw a grid with this many dots on each axis. Default = 100 |
bg.cex |
Float: Point cex for background / decision surface. Default = .5 |
bg.alpha |
Float: Point alpha for background / decision surface. Default = .2 |
bg.pch |
Integer vector: pch for background / decision surface. Default = c(3, 4) |
par.reset |
Logical: If TRUE, reset |
theme |
Character: Theme for mplot3_xy, "light" or "dark". Default = "light' |
col |
Color vector for classes. Default = |
contour.col |
Color for decision boundary. Default = "black" |
contour.lwd |
Float: Line width for decision boundary. Default = .3 |
point.pch |
Integer: pch for data points. Default = c(3, 4) |
point.alpha |
Float: Alpha for data points. Default = 1 |
If data has more than 2 variables, any variable not selected using vars
will be fixed to their mean
Underlying model (e.g. randomForest
, rpart
, etc) must support standard R predict format for classification:
predict(model, newdata, type = "class")
Predicted labels for background grid (invisibly)
E.D. Gennatas
## Not run:
dat <- as.data.frame(mlbench::mlbench.2dnormals(200))
mod.cart <- s_CART(dat)
mod.rf <- s_RF(dat)
mplot3_decision(mod.cart, dat)
mplot3_decision(mod.rf, dat)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.