Skip to contents

Density estimation using penalized B-splines with automatic selection of smoothing parameter. Calls pendensity::pendensity() from pendensity.

Dictionary

This Learner can be instantiated via lrn():

lrn("dens.pen")

Meta Information

Parameters

IdTypeDefaultLevelsRange
basecharacterbsplinebspline, gaussian-
no.basenumeric41\((-\infty, \infty)\)
max.iternumeric20\((-\infty, \infty)\)
lambda0numeric500\((-\infty, \infty)\)
qnumeric3\((-\infty, \infty)\)
sortlogicalTRUETRUE, FALSE-
with.borderuntyped--
mnumeric3\((-\infty, \infty)\)
epsnumeric0.01\((-\infty, \infty)\)

References

Schellhase, Christian, Kauermann, Göran (2012). “Density estimation and comparison with a penalized mixture approach.” Computational Statistics, 27(4), 757–777.

See also

Author

RaphaelS1

Super classes

mlr3::Learner -> mlr3proba::LearnerDens -> LearnerDensPenalized

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerDensPenalized$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = mlr3::lrn("dens.pen")
print(learner)
#> 
#> ── <LearnerDensPenalized> (dens.pen): Penalized Density Estimation ─────────────
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3, mlr3proba, mlr3extralearners, and pendensity
#> • Predict Types: [pdf] and cdf
#> • Feature Types: integer and numeric
#> • Encapsulation: none (fallback: -)
#> • Properties:
#> • Other settings: use_weights = 'error'

# Define a Task
task = mlr3::tsk("faithful")

# Create train and test set
ids = mlr3::partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)
#> [1] 1

print(learner$model)
#> PenDens_gaussian() 


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()
#> dens.logloss 
#>     0.942148