Skip to contents

Density estimator for discrete and continuous variables. Calls np::npudens() from np.

Dictionary

This Learner can be instantiated via lrn():

lrn("dens.mixed")

Meta Information

Parameters

IdTypeDefaultLevelsRange
bwsuntyped--
ckertypecharactergaussiangaussian, epanechnikov, uniform-
bwscalinglogicalFALSETRUE, FALSE-
bwmethodcharactercv.mlcv.ml, cv.ls, normal-reference-
bwtypecharacterfixedfixed, generalized_nn, adaptive_nn-
bandwidth.computelogicalFALSETRUE, FALSE-
ckerorderinteger2\([2, 8]\)
reminlogicalTRUETRUE, FALSE-
itmaxinteger10000\([1, \infty)\)
nmultiinteger-\([1, \infty)\)
ftolnumeric1.490116e-07\((-\infty, \infty)\)
tolnumeric0.0001490116\((-\infty, \infty)\)
smallnumeric1.490116e-05\((-\infty, \infty)\)
lbc.dirnumeric0.5\((-\infty, \infty)\)
dfc.dirnumeric0.5\((-\infty, \infty)\)
cfac.diruntyped2.5 * (3 - sqrt(5))-
initc.dirnumeric1\((-\infty, \infty)\)
lbd.dirnumeric0.1\((-\infty, \infty)\)
hbd.dirnumeric1\((-\infty, \infty)\)
dfac.diruntyped0.25 * (3 - sqrt(5))-
initd.dirnumeric1\((-\infty, \infty)\)
lbc.initnumeric0.1\((-\infty, \infty)\)
hbc.initnumeric2\((-\infty, \infty)\)
cfac.initnumeric0.5\((-\infty, \infty)\)
lbd.initnumeric0.1\((-\infty, \infty)\)
hbd.initnumeric0.9\((-\infty, \infty)\)
dfac.initnumeric0.37\((-\infty, \infty)\)
ukertypecharacter-aitchisonaitken, liracine-
okertypecharacter-wangvanryzin, liracine-

References

Li, Qi, Racine, Jeff (2003). “Nonparametric estimation of distributions with categorical and continuous data.” journal of multivariate analysis, 86(2), 266–292.

See also

Author

RaphaelS1

Super classes

mlr3::Learner -> mlr3proba::LearnerDens -> LearnerDensMixed

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

LearnerDensMixed$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = mlr3::lrn("dens.mixed")
print(learner)
#> <LearnerDensMixed:dens.mixed>: Kernel Density Estimator
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, mlr3proba, mlr3extralearners, np
#> * Predict Types:  [pdf]
#> * Feature Types: integer, numeric
#> * Properties: -

# 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)

print(learner$model)
#> MixedKDE_gaussian() 


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
#> 
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 |
Multistart 1 of 1 /
Multistart 1 of 1 |
Multistart 1 of 1 |
                   


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