| mlr_task_generators_blobs | R Documentation |
A TaskGenerator for isotropic Gaussian blobs, in the spirit of
sklearn.datasets.make_blobs().
k cluster centers are drawn uniformly from the hypercube [-center_box, center_box]^d, and the n
observations are assigned to the centers in a balanced fashion and perturbed with Gaussian noise of standard
deviation sd in each of the d dimensions.
The generated TaskClust only contains the numeric features x1, ..., xd; the cluster membership is not
stored in the task.
The parameters are initialized to k = 3, d = 2, sd = 1, and center_box = 10.
This TaskGenerator can be instantiated via the dictionary mlr_task_generators or with the associated sugar function tgen():
mlr_task_generators$get("blobs")
tgen("blobs")
| Id | Type | Default | Range |
| k | integer | - | [1, \infty) |
| d | integer | - | [1, \infty) |
| sd | numeric | - | [0, \infty) |
| center_box | numeric | - | [0, \infty) |
mlr3::TaskGenerator -> TaskGeneratorBlobs
TaskGeneratorBlobs$new()Creates a new instance of this R6 class.
TaskGeneratorBlobs$new()
TaskGeneratorBlobs$plot()Creates a simple plot of the first two features of generated data, colored by cluster membership.
TaskGeneratorBlobs$plot(n = 200L, pch = 19L, ...)
n(integer(1))
Number of samples to draw for the plot. Default is 200.
pch(integer(1))
Point char. Passed to graphics::plot().
...(any)
Additional arguments passed to graphics::plot().
TaskGeneratorBlobs$clone()The objects of this class are cloneable with this method.
TaskGeneratorBlobs$clone(deep = FALSE)
deepWhether to make a deep clone.
Dictionary of TaskGenerators: mlr3::mlr_task_generators
as.data.table(mlr_task_generators) for a table of available TaskGenerators in the
running session (depending on the loaded packages).
Other TaskGenerator:
mlr_task_generators_moons
generator = tgen("blobs")
plot(generator, n = 200)
task = generator$generate(200)
str(task$data())
# 4 well separated clusters in 3 dimensions
generator = tgen("blobs", k = 4, d = 3, sd = 0.5)
task = generator$generate(500)
task
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.