
Plots for GLMNet Learners
Source:R/LearnerClassifCVGlmnet.R, R/LearnerClassifGlmnet.R, R/LearnerRegrCVGlmnet.R, and 1 more
autoplot.LearnerClassifGlmnet.RdVisualizations for mlr3learners::LearnerClassifGlmnet.
The argument type controls what kind of plot is drawn.
Possible choices are:
"prediction"(default): Decision boundary of the learner and the true class labels."ggfortify": Visualizes the model using the package ggfortify.
Usage
# S3 method for class 'LearnerClassifCVGlmnet'
autoplot(
object,
type = "prediction",
task = NULL,
grid_points = 100L,
expand_range = 0,
theme = theme_minimal(),
...
)
# S3 method for class 'LearnerClassifGlmnet'
autoplot(
object,
type = "prediction",
task = NULL,
grid_points = 100L,
expand_range = 0,
theme = theme_minimal(),
...
)
# S3 method for class 'LearnerRegrCVGlmnet'
autoplot(
object,
type = "prediction",
task = NULL,
grid_points = 100L,
expand_range = 0,
theme = theme_minimal(),
...
)
# S3 method for class 'LearnerRegrGlmnet'
autoplot(
object,
type = "prediction",
task = NULL,
grid_points = 100L,
expand_range = 0,
theme = theme_minimal(),
...
)Arguments
- object
(mlr3learners::LearnerClassifGlmnet | mlr3learners::LearnerRegrGlmnet | mlr3learners::LearnerRegrCVGlmnet | mlr3learners::LearnerRegrCVGlmnet).
- type
(character(1)):
Type of the plot. See description.- task
(mlr3::Task)
Train task.- grid_points
(integer(1))
Number of grid points per feature dimension.- expand_range
(numeric(1))
Expand the range of the grid.- theme
(
ggplot2::theme())
Theggplot2::theme_minimal()is applied by default to all plots.- ...
(ignored).
References
Tang Y, Horikoshi M, Li W (2016). “ggfortify: Unified Interface to Visualize Statistical Result of Popular R Packages.” The R Journal, 8(2), 474–485. doi:10.32614/RJ-2016-060 .
Examples
if (FALSE) { # \dontrun{
library(mlr3)
library(mlr3viz)
library(mlr3learners)
# classification
task = tsk("sonar")
learner = lrn("classif.glmnet")
learner$train(task)
autoplot(learner, type = "ggfortify")
# regression
task = tsk("mtcars")
learner = lrn("regr.glmnet")
learner$train(task)
autoplot(learner, type = "ggfortify")
} # }