A LearnerClust for kernel k-means clustering implemented in kernlab::kkmeans()
.
kernlab::kkmeans()
doesn't have a default value for the number of clusters.
Therefore, the centers
parameter here is set to 2 by default.
Kernel parameters have to be passed directly and not by using the kpar
list in kkmeans
.
The predict method finds the nearest center in kernel distance to
assign clusters for new data points.
Dictionary
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
$get("clust.kkmeans")
mlr_learnerslrn("clust.kkmeans")
Meta Information
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, kernlab
Parameters
Id | Type | Default | Levels | Range |
centers | untyped | 2 | - | |
kernel | character | rbfdot | vanilladot, polydot, rbfdot, tanhdot, laplacedot, besseldot, anovadot, splinedot | - |
sigma | numeric | - | \([0, \infty)\) | |
degree | integer | 3 | \([1, \infty)\) | |
scale | numeric | 1 | \([0, \infty)\) | |
offset | numeric | 1 | \((-\infty, \infty)\) | |
order | integer | 1 | \((-\infty, \infty)\) | |
alg | character | kkmeans | kkmeans, kerninghan | - |
p | numeric | 1 | \((-\infty, \infty)\) |
Super classes
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustKKMeans
Examples
if (requireNamespace("kernlab")) {
learner = mlr3::lrn("clust.kkmeans")
print(learner)
# available parameters:
learner$param_set$ids()
}
#> <LearnerClustKKMeans:clust.kkmeans>: Kernel K-Means
#> * Model: -
#> * Parameters: centers=2
#> * Packages: mlr3, mlr3cluster, kernlab
#> * Predict Types: [partition]
#> * Feature Types: logical, integer, numeric
#> * Properties: complete, exclusive, partitional
#> [1] "centers" "kernel" "sigma" "degree" "scale" "offset" "order"
#> [8] "alg" "p"