mlr_task_generators_simdens: Density Task Generator for Package 'distr6'

mlr_task_generators_simdensR Documentation

Density Task Generator for Package 'distr6'

Description

A mlr3::TaskGenerator calling distr6::distrSimulate(). See distr6::distrSimulate() for an explanation of the hyperparameters. See distr6::listDistributions() for the names of the available distributions.

Dictionary

This TaskGenerator can be instantiated via the dictionary mlr_task_generators or with the associated sugar function tgen():

mlr_task_generators$get("simdens")
tgen("simdens")

Parameters

Id Type Default Levels
distribution character Normal Arcsine, Arrdist, Bernoulli, Beta, BetaNoncentral, Binomial, Categorical, Cauchy, ChiSquared, ChiSquaredNoncentral, ...
pars untyped -

Super class

mlr3::TaskGenerator -> TaskGeneratorSimdens

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
TaskGeneratorSimdens$new()

Method help()

Opens the corresponding help page referenced by field ⁠$man⁠.

Usage
TaskGeneratorSimdens$help()

Method clone()

The objects of this class are cloneable with this method.

Usage
TaskGeneratorSimdens$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

  • Dictionary of TaskGenerators: mlr3::mlr_task_generators

  • as.data.table(mlr_task_generators) for a table of available TaskGenerators in the running session

Other TaskGenerator: mlr_task_generators_coxed, mlr_task_generators_simsurv

Examples

# generate 20 samples from a standard Normal distribution
dens_gen = tgen("simdens")
dens_gen$param_set

task = dens_gen$generate(20)
head(task)

# generate 50 samples from a Binomial distribution with specific parameters
dens_gen = tgen("simdens", distribution = "Bernoulli", pars = list(prob = 0.8))
task = dens_gen$generate(50)
task$data()[["x"]]

mlr-org/mlr3proba documentation built on April 12, 2025, 4:38 p.m.