autoplot.PredictionClust: Plot for PredictionClust

Description Usage Arguments Value References Examples

View source: R/PredictionClust.R

Description

Generates plots for mlr3cluster::PredictionClust, depending on argument type:

Usage

1
2
## S3 method for class 'PredictionClust'
autoplot(object, task, row_ids = NULL, type = "scatter", ...)

Arguments

object

(mlr3cluster::PredictionClust).

task

(mlr3cluster::TaskClust).

row_ids

row ids to subset task data to ensure that only the data used to make predictions are shown in plots.

type

(character(1)):
Type of the plot. See description.

...

(any): Additional arguments, passed down to the respective geom.

Value

ggplot2::ggplot() object.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(mlr3)
library(mlr3cluster)
library(mlr3viz)

task = tsk("usarrests")
learner = lrn("clust.kmeans", centers = 3)
object = learner$train(task)$predict(task)

head(fortify(object))
autoplot(object, task)

mlr3viz documentation built on July 2, 2021, 1:07 a.m.