Calls pendensity::pendensity()
and the result is coerced to a distr6::Distribution.
Details
Density estimation using penalized B-splines with automatic selection of smoothing parameter.
Dictionary
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():
Meta Information
Type: "dens"
Predict Types:
pdf, cdf
Feature Types:
integer, numeric
Properties:
-
Packages: mlr3 mlr3proba pendensity distr6
References
Schellhase, Christian, Kauermann, Göran (2012). “Density estimation and comparison with a penalized mixture approach.” Computational Statistics, 27(4), 757–777.
Super classes
mlr3::Learner
-> mlr3proba::LearnerDens
-> LearnerDensPenalized
Examples
# Define the Learner
learner = lrn("dens.pen")
print(learner)
#>
#> ── <LearnerDensPenalized> (dens.pen): Penalized Density Estimation ─────────────
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3, mlr3proba, pendensity, and distr6
#> • Predict Types: [pdf] and cdf
#> • Feature Types: integer and numeric
#> • Encapsulation: none (fallback: -)
#> • Properties:
#> • Other settings: use_weights = 'error'
# Define a Task
task = tsk("faithful")
# Create train and test set
ids = partition(task)
# Train the learner on the training ids
learner$train(task, row_ids = ids$train)
#> [1] 1
#> [1] 2
#> [1] 3
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
#> 1.819792