| mlr_task_generators_moons | R Documentation |
A TaskGenerator for two interleaving half circles ("moons"), in the spirit of
sklearn.datasets.make_moons().
The n observations are split evenly between an upper half circle centered at the origin and a lower half circle
shifted to the right and down so that the two arcs interleave.
Each observation is perturbed with Gaussian noise of standard deviation sd.
The generated TaskClust only contains the numeric features x1 and x2; the cluster membership is not
stored in the task.
The parameter sd is initialized to 0.1.
The clusters are not convex, which makes this generator a standard test case for density-based and connectivity-based methods such as DBSCAN, single linkage or spectral clustering, where centroid-based methods such as k-means fail.
This TaskGenerator can be instantiated via the dictionary mlr_task_generators or with the associated sugar function tgen():
mlr_task_generators$get("moons")
tgen("moons")
| Id | Type | Default | Range |
| sd | numeric | - | [0, \infty) |
mlr3::TaskGenerator -> TaskGeneratorMoons
TaskGeneratorMoons$new()Creates a new instance of this R6 class.
TaskGeneratorMoons$new()
TaskGeneratorMoons$plot()Creates a simple plot of generated data, colored by cluster membership.
TaskGeneratorMoons$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().
TaskGeneratorMoons$clone()The objects of this class are cloneable with this method.
TaskGeneratorMoons$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_blobs
generator = tgen("moons")
plot(generator, n = 200)
task = generator$generate(200)
str(task$data())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.