Title: | Cluster Extension for 'mlr3' |
---|---|
Description: | Extends the 'mlr3' package with cluster analysis. |
Authors: | Damir Pulatov [cre, aut], Michel Lang [aut] |
Maintainer: | Damir Pulatov <[email protected]> |
License: | LGPL-3 |
Version: | 0.1.9 |
Built: | 2024-10-28 05:06:07 UTC |
Source: | https://github.com/mlr-org/mlr3cluster |
Extends the 'mlr3' package with cluster analysis.
Maintainer: Damir Pulatov [email protected]
Authors:
Michel Lang [email protected] (ORCID)
Useful links:
Report bugs at https://github.com/mlr-org/mlr3cluster/issues
Convert object to a PredictionClust.
as_prediction_clust(x, ...) ## S3 method for class 'PredictionClust' as_prediction_clust(x, ...) ## S3 method for class 'data.frame' as_prediction_clust(x, ...)
as_prediction_clust(x, ...) ## S3 method for class 'PredictionClust' as_prediction_clust(x, ...) ## S3 method for class 'data.frame' as_prediction_clust(x, ...)
x |
(any) |
... |
(any) |
if (requireNamespace("e1071")) { # create a prediction object task = tsk("usarrests") learner = lrn("clust.kmeans") learner = lrn("clust.cmeans", predict_type = "prob") learner$train(task) p = learner$predict(task) # convert to a data.table tab = as.data.table(p) # convert back to a Prediction as_prediction_clust(tab) # split data.table into a 3 data.tables based on UrbanPop f = cut(task$data(rows = tab$row_ids)$UrbanPop, 3) tabs = split(tab, f) # convert back to list of predictions preds = lapply(tabs, as_prediction_clust) # calculate performance in each group sapply(preds, function(p) p$score(task = task)) }
if (requireNamespace("e1071")) { # create a prediction object task = tsk("usarrests") learner = lrn("clust.kmeans") learner = lrn("clust.cmeans", predict_type = "prob") learner$train(task) p = learner$predict(task) # convert to a data.table tab = as.data.table(p) # convert back to a Prediction as_prediction_clust(tab) # split data.table into a 3 data.tables based on UrbanPop f = cut(task$data(rows = tab$row_ids)$UrbanPop, 3) tabs = split(tab, f) # convert back to list of predictions preds = lapply(tabs, as_prediction_clust) # calculate performance in each group sapply(preds, function(p) p$score(task = task)) }
Convert object to a TaskClust. This is a S3 generic, specialized for at least the following objects:
TaskClust: ensure the identity.
data.frame()
and DataBackend: provides an alternative to calling constructor of TaskClust.
as_task_clust(x, ...) ## S3 method for class 'TaskClust' as_task_clust(x, clone = FALSE, ...) ## S3 method for class 'data.frame' as_task_clust(x, id = deparse(substitute(x)), ...) ## S3 method for class 'DataBackend' as_task_clust(x, id = deparse(substitute(x)), ...) ## S3 method for class 'formula' as_task_clust(x, data, id = deparse(substitute(data)), ...)
as_task_clust(x, ...) ## S3 method for class 'TaskClust' as_task_clust(x, clone = FALSE, ...) ## S3 method for class 'data.frame' as_task_clust(x, id = deparse(substitute(x)), ...) ## S3 method for class 'DataBackend' as_task_clust(x, id = deparse(substitute(x)), ...) ## S3 method for class 'formula' as_task_clust(x, data, id = deparse(substitute(data)), ...)
x |
(any) |
... |
(any) |
clone |
( |
id |
( |
data |
( |
as_task_clust(datasets::USArrests)
as_task_clust(datasets::USArrests)
This Learner specializes mlr3::Learner for cluster problems:
task_type
is set to "clust"
.
Creates Predictions of class PredictionClust.
Possible values for predict_types
are:
"partition"
: Integer indicating the cluster membership.
"prob"
: Probability for belonging to each cluster.
Predefined learners can be found in the mlr3misc::Dictionary mlr3::mlr_learners.
mlr3::Learner
-> LearnerClust
assignments
(NULL
| vector()
)
Cluster assignments from learned model.
save_assignments
(logical()
)
Should assignments for 'train' data be saved in the learner?
Default is TRUE
.
new()
Creates a new instance of this R6 class.
LearnerClust$new( id, param_set = ps(), predict_types = "partition", feature_types = character(), properties = character(), packages = character(), label = NA_character_, man = NA_character_ )
id
(character(1)
)
Identifier for the new instance.
param_set
(paradox::ParamSet)
Set of hyperparameters.
predict_types
(character()
)
Supported predict types. Must be a subset of mlr_reflections$learner_predict_types
.
feature_types
(character()
)
Feature types the learner operates on. Must be a subset of mlr_reflections$task_feature_types
.
properties
(character()
)
Set of properties of the Learner.
Must be a subset of mlr_reflections$learner_properties
.
The following properties are currently standardized and understood by learners in mlr3:
"missings"
: The learner can handle missing values in the data.
"weights"
: The learner supports observation weights.
"importance"
: The learner supports extraction of importance scores, i.e. comes with an $importance()
extractor function (see section on optional extractors in Learner).
"selected_features"
: The learner supports extraction of the set of selected features, i.e. comes with a $selected_features()
extractor function (see section on optional extractors in Learner).
"oob_error"
: The learner supports extraction of estimated out of bag error, i.e. comes with a oob_error()
extractor function (see section on optional extractors in Learner).
packages
(character()
)
Set of required packages.
A warning is signaled by the constructor if at least one of the packages is not installed,
but loaded (not attached) later on-demand via requireNamespace()
.
label
(character(1)
)
Label for the new instance.
man
(character(1)
)
String in the format [pkg]::[topic]
pointing to a manual page for this object.
The referenced help package can be opened via method $help()
.
reset()
Reset assignments
field before calling parent's reset()
.
LearnerClust$reset()
clone()
The objects of this class are cloneable with this method.
LearnerClust$clone(deep = FALSE)
deep
Whether to make a deep clone.
library(mlr3) library(mlr3cluster) ids = mlr_learners$keys("^clust") ids # get a specific learner from mlr_learners: learner = lrn("clust.kmeans") print(learner)
library(mlr3) library(mlr3cluster) ids = mlr_learners$keys("^clust") ids # get a specific learner from mlr_learners: learner = lrn("clust.kmeans") print(learner)
This measure specializes mlr3::Measure for cluster analysis:
task_type
is set to "clust"
.
Possible values for predict_type
are "partition"
and "prob"
.
Predefined measures can be found in the mlr3misc::Dictionary mlr3::mlr_measures.
mlr3::Measure
-> MeasureClust
new()
Creates a new instance of this R6 class.
MeasureClust$new( id, range, minimize = NA, aggregator = NULL, properties = character(), predict_type = "partition", task_properties = character(), packages = character(), label = NA_character_, man = NA_character_ )
id
(character(1)
)
Identifier for the new instance.
range
(numeric(2)
)
Feasible range for this measure as c(lower_bound, upper_bound)
.
Both bounds may be infinite.
minimize
(logical(1)
)
Set to TRUE
if good predictions correspond to small values,
and to FALSE
if good predictions correspond to large values.
If set to NA
(default), tuning this measure is not possible.
aggregator
(function(x)
)
Function to aggregate individual performance scores x
where x
is a numeric vector.
If NULL
, defaults to mean()
.
properties
(character()
)
Properties of the measure.
Must be a subset of mlr_reflections$measure_properties.
Supported by mlr3
:
"requires_task"
(requires the complete Task),
"requires_learner"
(requires the trained Learner),
"requires_train_set"
(requires the training indices from the Resampling), and
"na_score"
(the measure is expected to occasionally return NA
or NaN
).
predict_type
(character(1)
)
Required predict type of the Learner.
Possible values are stored in mlr_reflections$learner_predict_types.
task_properties
(character()
)
Required task properties, see Task.
packages
(character()
)
Set of required packages.
A warning is signaled by the constructor if at least one of the packages is not installed,
but loaded (not attached) later on-demand via requireNamespace()
.
label
(character(1)
)
Label for the new instance.
man
(character(1)
)
String in the format [pkg]::[topic]
pointing to a manual page for this object.
The referenced help package can be opened via method $help()
.
Example cluster measures: clust.dunn
A LearnerClust for agglomerative hierarchical clustering implemented in cluster::agnes()
.
The predict method uses stats::cutree()
which cuts the tree resulting from
hierarchical clustering into specified number of groups (see parameter k
).
The default number for k
is 2.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.agnes") lrn("clust.agnes")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, cluster
Id | Type | Default | Levels | Range |
metric | character | euclidean | euclidean, manhattan | - |
stand | logical | FALSE | TRUE, FALSE | - |
method | character | average | average, single, complete, ward, weighted, flexible, gaverage | - |
trace.lev | integer | 0 | |
|
k | integer | 2 | |
|
par.method | untyped | - | - | |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustAgnes
new()
Creates a new instance of this R6 class.
LearnerClustAgnes$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustAgnes$clone(deep = FALSE)
deep
Whether to make a deep clone.
Kaufman, Leonard, Rousseeuw, J P (2009). Finding groups in data: an introduction to cluster analysis. John Wiley & Sons.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("cluster")) { learner = mlr3::lrn("clust.agnes") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("cluster")) { learner = mlr3::lrn("clust.agnes") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for Affinity Propagation clustering implemented in apcluster::apcluster()
.
apcluster::apcluster()
doesn't have set a default for similarity function.
The predict method computes the closest cluster exemplar to find the
cluster memberships for new data.
The code is taken from
StackOverflow
answer by the apcluster
package maintainer.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.ap") lrn("clust.ap")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, apcluster
Id | Type | Default | Levels | Range |
s | untyped | - | - | |
p | untyped | NA | - | |
q | numeric | - | |
|
maxits | integer | 1000 | |
|
convits | integer | 100 | |
|
lam | numeric | 0.9 | |
|
includeSim | logical | FALSE | TRUE, FALSE | - |
details | logical | FALSE | TRUE, FALSE | - |
nonoise | logical | FALSE | TRUE, FALSE | - |
seed | integer | - | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustAP
new()
Creates a new instance of this R6 class.
LearnerClustAP$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustAP$clone(deep = FALSE)
deep
Whether to make a deep clone.
Bodenhofer, Ulrich, Kothmeier, Andreas, Hochreiter, Sepp (2011). “APCluster: an R package for affinity propagation clustering.” Bioinformatics, 27(17), 2463–2464.
Frey, J B, Dueck, Delbert (2007). “Clustering by passing messages between data points.” science, 315(5814), 972–976.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("apcluster")) { learner = mlr3::lrn("clust.ap") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("apcluster")) { learner = mlr3::lrn("clust.ap") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for fuzzy clustering implemented in e1071::cmeans()
.
e1071::cmeans()
doesn't have a default value for the number of clusters.
Therefore, the centers
parameter here is set to 2 by default.
The predict method uses clue::cl_predict()
to compute the
cluster memberships for new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.cmeans") lrn("clust.cmeans")
Task type: “clust”
Predict Types: “partition”, “prob”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, e1071
Id | Type | Default | Levels | Range |
centers | untyped | 2 | - | |
iter.max | integer | 100 | |
|
verbose | logical | FALSE | TRUE, FALSE | - |
dist | character | euclidean | euclidean, manhattan | - |
method | character | cmeans | cmeans, ufcl | - |
m | numeric | 2 | |
|
rate.par | numeric | - | |
|
weights | untyped | 1 | - | |
control | untyped | - | - | |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustCMeans
new()
Creates a new instance of this R6 class.
LearnerClustCMeans$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustCMeans$clone(deep = FALSE)
deep
Whether to make a deep clone.
Dimitriadou, Evgenia, Hornik, Kurt, Leisch, Friedrich, Meyer, David, Weingessel, Andreas (2008). “Misc functions of the Department of Statistics (e1071), TU Wien.” R package, 1, 5–24.
Bezdek, C J (2013). Pattern recognition with fuzzy objective function algorithms. Springer Science & Business Media.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("e1071")) { learner = mlr3::lrn("clust.cmeans") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("e1071")) { learner = mlr3::lrn("clust.cmeans") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for Cobweb clustering implemented in RWeka::Cobweb()
.
The predict method uses RWeka::predict.Weka_clusterer()
to compute the
cluster memberships for new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.cobweb") lrn("clust.cobweb")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, RWeka
Id | Type | Default | Range |
A | numeric | 1 | |
C | numeric | 0.002 | |
S | integer | 42 | |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustCobweb
new()
Creates a new instance of this R6 class.
LearnerClustCobweb$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustCobweb$clone(deep = FALSE)
deep
Whether to make a deep clone.
Witten, H I, Frank, Eibe (2002). “Data mining: practical machine learning tools and techniques with Java implementations.” Acm Sigmod Record, 31(1), 76–77.
Fisher, H D (1987). “Knowledge acquisition via incremental conceptual clustering.” Machine learning, 2, 139–172.
Gennari, H J, Langley, Pat, Fisher, Doug (1989). “Models of incremental concept formation.” Artificial intelligence, 40(1-3), 11–61.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.cobweb") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.cobweb") print(learner) # available parameters: learner$param_set$ids() }
DBSCAN (Density-based spatial clustering of applications with noise) clustering.
Calls dbscan::dbscan()
from dbscan.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.dbscan") lrn("clust.dbscan")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, dbscan
Id | Type | Default | Levels | Range |
eps | numeric | - | |
|
minPts | integer | 5 | |
|
borderPoints | logical | TRUE | TRUE, FALSE | - |
weights | untyped | - | - | |
search | character | kdtree | kdtree, linear, dist | - |
bucketSize | integer | 10 | |
|
splitRule | character | SUGGEST | STD, MIDPT, FAIR, SL_MIDPT, SL_FAIR, SUGGEST | - |
approx | numeric | 0 | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustDBSCAN
new()
Creates a new instance of this R6 class.
LearnerClustDBSCAN$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustDBSCAN$clone(deep = FALSE)
deep
Whether to make a deep clone.
Hahsler M, Piekenbrock M, Doran D (2019). “dbscan: Fast Density-Based Clustering with R.” Journal of Statistical Software, 91(1), 1–30. doi:10.18637/jss.v091.i01.
Ester, Martin, Kriegel, Hans-Peter, Sander, Jörg, Xu, Xiaowei, others (1996). “A density-based algorithm for discovering clusters in large spatial databases with noise.” In kdd, volume 96 number 34, 226–231.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("dbscan")) { learner = mlr3::lrn("clust.dbscan") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("dbscan")) { learner = mlr3::lrn("clust.dbscan") print(learner) # available parameters: learner$param_set$ids() }
DBSCAN (Density-based spatial clustering of applications with noise) clustering.
Calls fpc::dbscan()
from fpc.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.dbscan_fpc") lrn("clust.dbscan_fpc")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, fpc
Id | Type | Default | Levels | Range |
eps | numeric | - | |
|
MinPts | integer | 5 | |
|
scale | logical | FALSE | TRUE, FALSE | - |
method | character | - | hybrid, raw, dist | - |
seeds | logical | TRUE | TRUE, FALSE | - |
showplot | untyped | FALSE | - | |
countmode | untyped | - | ||
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustDBSCANfpc
new()
Creates a new instance of this R6 class.
LearnerClustDBSCANfpc$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustDBSCANfpc$clone(deep = FALSE)
deep
Whether to make a deep clone.
Ester, Martin, Kriegel, Hans-Peter, Sander, Jörg, Xu, Xiaowei, others (1996). “A density-based algorithm for discovering clusters in large spatial databases with noise.” In kdd, volume 96 number 34, 226–231.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("fpc")) { learner = mlr3::lrn("clust.dbscan_fpc") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("fpc")) { learner = mlr3::lrn("clust.dbscan_fpc") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for divisive hierarchical clustering implemented in cluster::diana()
.
The predict method uses stats::cutree()
which cuts the tree resulting from
hierarchical clustering into specified number of groups (see parameter k
).
The default value for k
is 2.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.diana") lrn("clust.diana")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, cluster
Id | Type | Default | Levels | Range |
metric | character | euclidean | euclidean, manhattan | - |
stand | logical | FALSE | TRUE, FALSE | - |
trace.lev | integer | 0 | |
|
k | integer | 2 | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustDiana
new()
Creates a new instance of this R6 class.
LearnerClustDiana$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustDiana$clone(deep = FALSE)
deep
Whether to make a deep clone.
Kaufman, Leonard, Rousseeuw, J P (2009). Finding groups in data: an introduction to cluster analysis. John Wiley & Sons.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("cluster")) { learner = mlr3::lrn("clust.diana") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("cluster")) { learner = mlr3::lrn("clust.diana") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for Expectation-Maximization clustering implemented in
RWeka::list_Weka_interfaces()
.
The predict method uses RWeka::predict.Weka_clusterer()
to compute the
cluster memberships for new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.em") lrn("clust.em")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, RWeka
Id | Type | Default | Levels | Range |
I | integer | 100 | |
|
ll_cv | numeric | 1e-06 | |
|
ll_iter | numeric | 1e-06 | |
|
M | numeric | 1e-06 | |
|
max | integer | -1 | |
|
N | integer | -1 | |
|
num_slots | integer | 1 | |
|
S | integer | 100 | |
|
X | integer | 10 | |
|
K | integer | 10 | |
|
V | logical | FALSE | TRUE, FALSE | - |
output_debug_info | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustEM
new()
Creates a new instance of this R6 class.
LearnerClustEM$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustEM$clone(deep = FALSE)
deep
Whether to make a deep clone.
Witten, H I, Frank, Eibe (2002). “Data mining: practical machine learning tools and techniques with Java implementations.” Acm Sigmod Record, 31(1), 76–77.
Dempster, P A, Laird, M N, Rubin, B D (1977). “Maximum likelihood from incomplete data via the EM algorithm.” Journal of the royal statistical society: series B (methodological), 39(1), 1–22.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.em") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.em") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for fuzzy clustering implemented in cluster::fanny()
.
cluster::fanny()
doesn't have a default value for the number of clusters.
Therefore, the k
parameter which corresponds to the number
of clusters here is set to 2 by default.
The predict method copies cluster assignments and memberships
generated for train data. The predict does not work for
new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.fanny") lrn("clust.fanny")
Task type: “clust”
Predict Types: “partition”, “prob”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, cluster
Id | Type | Default | Levels | Range |
k | integer | 2 | |
|
memb.exp | numeric | 2 | |
|
metric | character | euclidean | euclidean, manhattan, SqEuclidean | - |
stand | logical | FALSE | TRUE, FALSE | - |
maxit | integer | 500 | |
|
tol | numeric | 1e-15 | |
|
trace.lev | integer | 0 | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustFanny
new()
Creates a new instance of this R6 class.
LearnerClustFanny$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustFanny$clone(deep = FALSE)
deep
Whether to make a deep clone.
Kaufman, Leonard, Rousseeuw, J P (2009). Finding groups in data: an introduction to cluster analysis. John Wiley & Sons.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("cluster")) { learner = mlr3::lrn("clust.fanny") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("cluster")) { learner = mlr3::lrn("clust.fanny") print(learner) # available parameters: learner$param_set$ids() }
A simple LearnerClust which randomly (but evenly) assigns observations to
num_clusters
partitions (default: 1 partition).
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.featureless") lrn("clust.featureless")
Task type: “clust”
Predict Types: “partition”, “prob”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster
Id | Type | Default | Range |
num_clusters | integer | 1 | |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustFeatureless
new()
Creates a new instance of this R6 class.
LearnerClustFeatureless$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustFeatureless$clone(deep = FALSE)
deep
Whether to make a deep clone.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("mlr3")) { learner = mlr3::lrn("clust.featureless") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("mlr3")) { learner = mlr3::lrn("clust.featureless") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for Farthest First clustering implemented in RWeka::FarthestFirst()
.
The predict method uses RWeka::predict.Weka_clusterer()
to compute the
cluster memberships for new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.ff") lrn("clust.ff")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, RWeka
Id | Type | Default | Levels | Range |
N | integer | 2 | |
|
S | integer | 1 | |
|
output_debug_info | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustFF
new()
Creates a new instance of this R6 class.
LearnerClustFarthestFirst$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustFarthestFirst$clone(deep = FALSE)
deep
Whether to make a deep clone.
Witten, H I, Frank, Eibe (2002). “Data mining: practical machine learning tools and techniques with Java implementations.” Acm Sigmod Record, 31(1), 76–77.
Hochbaum, S D, Shmoys, B D (1985). “A best possible heuristic for the k-center problem.” Mathematics of operations research, 10(2), 180–184.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.ff") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.ff") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for agglomerative hierarchical clustering implemented in stats::hclust()
.
Difference Calculation is done by stats::dist()
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.hclust") lrn("clust.hclust")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, 'stats'
Id | Type | Default | Levels | Range |
method | character | complete | ward.D, ward.D2, single, complete, average, mcquitty, median, centroid | - |
members | untyped | - | ||
distmethod | character | euclidean | euclidean, maximum, manhattan, canberra, binary, minkowski | - |
diag | logical | FALSE | TRUE, FALSE | - |
upper | logical | FALSE | TRUE, FALSE | - |
p | numeric | 2 | |
|
k | integer | 2 | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustHclust
new()
Creates a new instance of this R6 class.
LearnerClustHclust$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustHclust$clone(deep = FALSE)
deep
Whether to make a deep clone.
Becker, A R, Chambers, M J, Wilks, R A (1988). The New S Language. Wadsworth & Brooks/Cole.
Everitt, S B (1974). Cluster Analysis. Heinemann Educational Books.
Hartigan, A J (1975). Clustering Algorithms. John Wiley & Sons.
Sneath, HA P, Sokal, R R (1973). Numerical Taxonomy. Freeman.
Anderberg, R M (1973). Cluster Analysis for Applications. Academic Press.
Gordon, David A (1999). Classification, 2 edition. Chapman and Hall / CRC.
Murtagh, Fionn (1985). “Multidimensional Clustering Algorithms.” In COMPSTAT Lectures 4. Physica-Verlag.
McQuitty, L L (1966). “Similarity Analysis by Reciprocal Pairs for Discrete and Continuous Data.” Educational and Psychological Measurement, 26(4), 825–831. doi:10.1177/001316446602600402.
Legendre, Pierre, Legendre, Louis (2012). Numerical Ecology, 3 edition. Elsevier Science BV.
Murtagh, Fionn, Legendre, Pierre (2014). “Ward's Hierarchical Agglomerative Clustering Method: Which Algorithms Implement Ward's Criterion?” Journal of Classification, 31, 274–295. doi:10.1007/s00357-014-9161-z.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("stats")) { learner = mlr3::lrn("clust.hclust") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("stats")) { learner = mlr3::lrn("clust.hclust") print(learner) # available parameters: learner$param_set$ids() }
HDBSCAN (Hierarchical DBSCAN) clustering.
Calls dbscan::hdbscan()
from dbscan.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.hdbscan") lrn("clust.hdbscan")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, dbscan
Id | Type | Default | Levels | Range |
minPts | integer | - | |
|
gen_hdbscan_tree | logical | FALSE | TRUE, FALSE | - |
gen_simplified_tree | logical | FALSE | TRUE, FALSE | - |
verbose | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustHDBSCAN
new()
Creates a new instance of this R6 class.
LearnerClustHDBSCAN$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustHDBSCAN$clone(deep = FALSE)
deep
Whether to make a deep clone.
Hahsler M, Piekenbrock M, Doran D (2019). “dbscan: Fast Density-Based Clustering with R.” Journal of Statistical Software, 91(1), 1–30. doi:10.18637/jss.v091.i01.
Campello, JGB R, Moulavi, Davoud, Sander, Jörg (2013). “Density-based clustering based on hierarchical density estimates.” In Pacific-Asia conference on knowledge discovery and data mining, 160–172. Springer.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("dbscan")) { learner = mlr3::lrn("clust.hdbscan") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("dbscan")) { learner = mlr3::lrn("clust.hdbscan") print(learner) # available parameters: learner$param_set$ids() }
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.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.kkmeans") lrn("clust.kkmeans")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, kernlab
Id | Type | Default | Levels | Range |
centers | untyped | 2 | - | |
kernel | character | rbfdot | vanilladot, polydot, rbfdot, tanhdot, laplacedot, besseldot, anovadot, splinedot | - |
sigma | numeric | - | |
|
degree | integer | 3 | |
|
scale | numeric | 1 | |
|
offset | numeric | 1 | |
|
order | integer | 1 | |
|
alg | character | kkmeans | kkmeans, kerninghan | - |
p | numeric | 1 | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustKKMeans
new()
Creates a new instance of this R6 class.
LearnerClustKKMeans$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustKKMeans$clone(deep = FALSE)
deep
Whether to make a deep clone.
Karatzoglou, Alexandros, Smola, Alexandros, Hornik, Kurt, Zeileis, Achim (2004). “kernlab-an S4 package for kernel methods in R.” Journal of statistical software, 11, 1–20.
Dhillon, S I, Guan, Yuqiang, Kulis, Brian (2004). A unified view of kernel k-means, spectral clustering and graph cuts. Citeseer.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("kernlab")) { learner = mlr3::lrn("clust.kkmeans") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("kernlab")) { learner = mlr3::lrn("clust.kkmeans") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for k-means clustering implemented in stats::kmeans()
.
stats::kmeans()
doesn't have a default value for the number of clusters.
Therefore, the centers
parameter here is set to 2 by default.
The predict method uses clue::cl_predict()
to compute the
cluster memberships for new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.kmeans") lrn("clust.kmeans")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, 'stats', clue
Id | Type | Default | Levels | Range |
centers | untyped | 2 | - | |
iter.max | integer | 10 | |
|
algorithm | character | Hartigan-Wong | Hartigan-Wong, Lloyd, Forgy, MacQueen | - |
nstart | integer | 1 | |
|
trace | integer | 0 | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustKMeans
new()
Creates a new instance of this R6 class.
LearnerClustKMeans$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustKMeans$clone(deep = FALSE)
deep
Whether to make a deep clone.
Forgy, W E (1965). “Cluster analysis of multivariate data: efficiency versus interpretability of classifications.” Biometrics, 21, 768–769.
Hartigan, A J, Wong, A M (1979). “Algorithm AS 136: A K-means clustering algorithm.” Journal of the Royal Statistical Society. Series C (Applied Statistics), 28(1), 100–108. doi:10.2307/2346830.
Lloyd, P S (1982). “Least squares quantization in PCM.” IEEE Transactions on Information Theory, 28(2), 129–137.
MacQueen, James (1967). “Some methods for classification and analysis of multivariate observations.” In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, volume 1, 281–297.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("stats") && requireNamespace("clue")) { learner = mlr3::lrn("clust.kmeans") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("stats") && requireNamespace("clue")) { learner = mlr3::lrn("clust.kmeans") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for mini batch k-means clustering implemented in ClusterR::MiniBatchKmeans()
.
ClusterR::MiniBatchKmeans()
doesn't have a default value for the number of clusters.
Therefore, the clusters
parameter here is set to 2 by default.
The predict method uses ClusterR::predict_MBatchKMeans()
to compute the
cluster memberships for new data.
The learner supports both partitional and fuzzy clustering.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.MBatchKMeans") lrn("clust.MBatchKMeans")
Task type: “clust”
Predict Types: “partition”, “prob”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, ClusterR
Id | Type | Default | Levels | Range |
clusters | integer | 2 | |
|
batch_size | integer | 10 | |
|
num_init | integer | 1 | |
|
max_iters | integer | 100 | |
|
init_fraction | numeric | 1 | |
|
initializer | character | kmeans++ | optimal_init, quantile_init, kmeans++, random | - |
early_stop_iter | integer | 10 | |
|
verbose | logical | FALSE | TRUE, FALSE | - |
CENTROIDS | untyped | - | ||
tol | numeric | 1e-04 | |
|
tol_optimal_init | numeric | 0.3 | |
|
seed | integer | 1 | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustMiniBatchKMeans
new()
Creates a new instance of this R6 class.
LearnerClustMiniBatchKMeans$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustMiniBatchKMeans$clone(deep = FALSE)
deep
Whether to make a deep clone.
Sculley, David (2010). “Web-scale k-means clustering.” In Proceedings of the 19th international conference on World wide web, 1177–1178.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("ClusterR")) { learner = mlr3::lrn("clust.MBatchKMeans") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("ClusterR")) { learner = mlr3::lrn("clust.MBatchKMeans") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for model-based clustering implemented in mclust::Mclust()
.
The predict method uses mclust::predict.Mclust()
to compute the
cluster memberships for new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.mclust") lrn("clust.mclust")
Task type: “clust”
Predict Types: “partition”, “prob”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, mclust
Id | Type | Default |
G | untyped | :, 1, 9 |
modelNames | untyped | - |
prior | untyped | - |
control | untyped | mclust::emControl |
initialization | untyped | - |
x | untyped | - |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustMclust
new()
Creates a new instance of this R6 class.
LearnerClustMclust$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustMclust$clone(deep = FALSE)
deep
Whether to make a deep clone.
Scrucca, Luca, Fop, Michael, Murphy, Brendan T, Raftery, E A (2016). “mclust 5: clustering, classification and density estimation using Gaussian finite mixture models.” The R journal, 8(1), 289.
Fraley, Chris, Raftery, E A (2002). “Model-based clustering, discriminant analysis, and density estimation.” Journal of the American statistical Association, 97(458), 611–631.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("mclust")) { learner = mlr3::lrn("clust.mclust") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("mclust")) { learner = mlr3::lrn("clust.mclust") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for Mean Shift clustering implemented in LPCM::ms()
.
There is no predict method for LPCM::ms()
, so the method
returns cluster labels for the 'training' data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.meanshift") lrn("clust.meanshift")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, LPCM
Id | Type | Default | Range |
h | untyped | - | - |
subset | untyped | - | - |
scaled | integer | 1 | |
iter | integer | 200 | |
thr | numeric | 0.01 | |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustMeanShift
new()
Creates a new instance of this R6 class.
LearnerClustMeanShift$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustMeanShift$clone(deep = FALSE)
deep
Whether to make a deep clone.
Cheng, Yizong (1995). “Mean shift, mode seeking, and clustering.” IEEE transactions on pattern analysis and machine intelligence, 17(8), 790–799.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("LPCM")) { learner = mlr3::lrn("clust.meanshift") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("LPCM")) { learner = mlr3::lrn("clust.meanshift") print(learner) # available parameters: learner$param_set$ids() }
OPTICS (Ordering points to identify the clustering structure) point ordering clustering.
Calls dbscan::optics()
from dbscan.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.optics") lrn("clust.optics")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, dbscan
Id | Type | Default | Levels | Range |
eps | numeric | NULL | |
|
minPts | integer | 5 | |
|
search | character | kdtree | kdtree, linear, dist | - |
bucketSize | integer | 10 | |
|
splitRule | character | SUGGEST | STD, MIDPT, FAIR, SL_MIDPT, SL_FAIR, SUGGEST | - |
approx | numeric | 0 | |
|
eps_cl | numeric | - | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustOPTICS
new()
Creates a new instance of this R6 class.
LearnerClustOPTICS$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustOPTICS$clone(deep = FALSE)
deep
Whether to make a deep clone.
Hahsler M, Piekenbrock M, Doran D (2019). “dbscan: Fast Density-Based Clustering with R.” Journal of Statistical Software, 91(1), 1–30. doi:10.18637/jss.v091.i01.
Ankerst, Mihael, Breunig, M M, Kriegel, Hans-Peter, Sander, Jörg (1999). “OPTICS: Ordering points to identify the clustering structure.” ACM Sigmod record, 28(2), 49–60.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("dbscan")) { learner = mlr3::lrn("clust.optics") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("dbscan")) { learner = mlr3::lrn("clust.optics") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for PAM clustering implemented in cluster::pam()
.
cluster::pam()
doesn't have a default value for the number of clusters.
Therefore, the k
parameter which corresponds to the number
of clusters here is set to 2 by default.
The predict method uses clue::cl_predict()
to compute the
cluster memberships for new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.pam") lrn("clust.pam")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, cluster
Id | Type | Default | Levels | Range |
k | integer | 2 | |
|
metric | character | - | euclidian, manhattan | - |
medoids | untyped | - | ||
stand | logical | FALSE | TRUE, FALSE | - |
do.swap | logical | TRUE | TRUE, FALSE | - |
pamonce | integer | 0 | |
|
trace.lev | integer | 0 | |
|
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustPAM
new()
Creates a new instance of this R6 class.
LearnerClustPAM$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustPAM$clone(deep = FALSE)
deep
Whether to make a deep clone.
Reynolds, P A, Richards, Graeme, de la Iglesia, Beatriz, Rayward-Smith, J V (2006). “Clustering rules: a comparison of partitioning and hierarchical clustering algorithms.” Journal of Mathematical Modelling and Algorithms, 5, 475–504.
Schubert, Erich, Rousseeuw, J P (2019). “Faster k-medoids clustering: improving the PAM, CLARA, and CLARANS algorithms.” In Similarity Search and Applications: 12th International Conference, SISAP 2019, Newark, NJ, USA, October 2–4, 2019, Proceedings 12, 171–187. Springer.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.xmeans
if (requireNamespace("cluster")) { learner = mlr3::lrn("clust.pam") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("cluster")) { learner = mlr3::lrn("clust.pam") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for Simple K Means clustering implemented in RWeka::SimpleKMeans()
.
The predict method uses RWeka::predict.Weka_clusterer()
to compute the
cluster memberships for new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.SimpleKMeans") lrn("clust.SimpleKMeans")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, RWeka
Id | Type | Default | Levels | Range |
A | untyped | weka.core.EuclideanDistance | - | |
C | logical | FALSE | TRUE, FALSE | - |
fast | logical | FALSE | TRUE, FALSE | - |
I | integer | 100 | |
|
init | integer | 0 | |
|
M | logical | FALSE | TRUE, FALSE | - |
max_candidates | integer | 100 | |
|
min_density | integer | 2 | |
|
N | integer | 2 | |
|
num_slots | integer | 1 | |
|
O | logical | FALSE | TRUE, FALSE | - |
periodic_pruning | integer | 10000 | |
|
S | integer | 10 | |
|
t2 | numeric | -1 | |
|
t1 | numeric | -1.5 | |
|
V | logical | FALSE | TRUE, FALSE | - |
output_debug_info | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustSimpleKMeans
new()
Creates a new instance of this R6 class.
LearnerClustSimpleKMeans$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustSimpleKMeans$clone(deep = FALSE)
deep
Whether to make a deep clone.
Witten, H I, Frank, Eibe (2002). “Data mining: practical machine learning tools and techniques with Java implementations.” Acm Sigmod Record, 31(1), 76–77.
Forgy, W E (1965). “Cluster analysis of multivariate data: efficiency versus interpretability of classifications.” Biometrics, 21, 768–769.
Lloyd, P S (1982). “Least squares quantization in PCM.” IEEE Transactions on Information Theory, 28(2), 129–137.
MacQueen, James (1967). “Some methods for classification and analysis of multivariate observations.” In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, volume 1, 281–297.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
,
mlr_learners_clust.xmeans
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.SimpleKMeans") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.SimpleKMeans") print(learner) # available parameters: learner$param_set$ids() }
A LearnerClust for X-means clustering implemented in RWeka::XMeans()
.
The predict method uses RWeka::predict.Weka_clusterer()
to compute the
cluster memberships for new data.
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("clust.xmeans") lrn("clust.xmeans")
Task type: “clust”
Predict Types: “partition”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3cluster, RWeka
Id | Type | Default | Levels | Range |
B | numeric | 1 | |
|
C | numeric | 0 | |
|
D | untyped | weka.core.EuclideanDistance | - | |
H | integer | 4 | |
|
I | integer | 1 | |
|
J | integer | 1000 | |
|
K | untyped | - | ||
L | integer | 2 | |
|
M | integer | 1000 | |
|
S | integer | 10 | |
|
U | integer | 0 | |
|
use_kdtree | logical | FALSE | TRUE, FALSE | - |
N | untyped | - | - | |
O | untyped | - | - | |
Y | untyped | - | - | |
output_debug_info | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3cluster::LearnerClust
-> LearnerClustXMeans
new()
Creates a new instance of this R6 class.
LearnerClustXMeans$new()
clone()
The objects of this class are cloneable with this method.
LearnerClustXMeans$clone(deep = FALSE)
deep
Whether to make a deep clone.
Witten, H I, Frank, Eibe (2002). “Data mining: practical machine learning tools and techniques with Java implementations.” Acm Sigmod Record, 31(1), 76–77.
Pelleg, Dan, Moore, W A, others (2000). “X-means: Extending k-means with efficient estimation of the number of clusters.” In Icml, volume 1, 727–734.
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_clust.MBatchKMeans
,
mlr_learners_clust.SimpleKMeans
,
mlr_learners_clust.agnes
,
mlr_learners_clust.ap
,
mlr_learners_clust.cmeans
,
mlr_learners_clust.cobweb
,
mlr_learners_clust.dbscan
,
mlr_learners_clust.dbscan_fpc
,
mlr_learners_clust.diana
,
mlr_learners_clust.em
,
mlr_learners_clust.fanny
,
mlr_learners_clust.featureless
,
mlr_learners_clust.ff
,
mlr_learners_clust.hclust
,
mlr_learners_clust.hdbscan
,
mlr_learners_clust.kkmeans
,
mlr_learners_clust.kmeans
,
mlr_learners_clust.mclust
,
mlr_learners_clust.meanshift
,
mlr_learners_clust.optics
,
mlr_learners_clust.pam
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.xmeans") print(learner) # available parameters: learner$param_set$ids() }
if (requireNamespace("RWeka")) { learner = mlr3::lrn("clust.xmeans") print(learner) # available parameters: learner$param_set$ids() }
The score function calls fpc::cluster.stats()
from package fpc.
"ch" is used subset output of the function call.
R6::R6Class()
inheriting from MeasureClust.
This measures can be retrieved from the dictionary mlr_measures:
mlr_measures$get("clust.ch") msr("clust.ch")
Range:
Minimize: FALSE
Required predict type: partition
Dictionary of Measures: mlr3::mlr_measures
as.data.table(mlr_measures)
for a complete table of all (also dynamically created) mlr3::Measure implementations.
Other cluster measures:
mlr_measures_clust.dunn
,
mlr_measures_clust.silhouette
,
mlr_measures_clust.wss
The score function calls fpc::cluster.stats()
from package fpc.
"dunn" is used subset output of the function call.
R6::R6Class()
inheriting from MeasureClust.
This measures can be retrieved from the dictionary mlr_measures:
mlr_measures$get("clust.dunn") msr("clust.dunn")
Range:
Minimize: FALSE
Required predict type: partition
Dictionary of Measures: mlr3::mlr_measures
as.data.table(mlr_measures)
for a complete table of all (also dynamically created) mlr3::Measure implementations.
Other cluster measures:
mlr_measures_clust.ch
,
mlr_measures_clust.silhouette
,
mlr_measures_clust.wss
The score function calls cluster::silhouette()
from package cluster.
"sil_width" is used subset output of the function call.
R6::R6Class()
inheriting from MeasureClust.
This measures can be retrieved from the dictionary mlr_measures:
mlr_measures$get("clust.silhouette") msr("clust.silhouette")
Range:
Minimize: FALSE
Required predict type: partition
Dictionary of Measures: mlr3::mlr_measures
as.data.table(mlr_measures)
for a complete table of all (also dynamically created) mlr3::Measure implementations.
Other cluster measures:
mlr_measures_clust.ch
,
mlr_measures_clust.dunn
,
mlr_measures_clust.wss
The score function calls fpc::cluster.stats()
from package fpc.
"within.cluster.ss" is used subset output of the function call.
R6::R6Class()
inheriting from MeasureClust.
This measures can be retrieved from the dictionary mlr_measures:
mlr_measures$get("clust.wss") msr("clust.wss")
Range:
Minimize: TRUE
Required predict type: partition
Dictionary of Measures: mlr3::mlr_measures
as.data.table(mlr_measures)
for a complete table of all (also dynamically created) mlr3::Measure implementations.
Other cluster measures:
mlr_measures_clust.ch
,
mlr_measures_clust.dunn
,
mlr_measures_clust.silhouette
A cluster task for the cluster::ruspini data set.
R6::R6Class inheriting from TaskClust.
mlr_tasks$get("ruspini") tsk("ruspini")
Ruspini EH (1970). “Numerical methods for fuzzy clustering.” Information Sciences, 2(3), 319-350. doi:10.1016/S0020-0255(70)80056-1.
A cluster task for the datasets::USArrests data set.
Rownames are stored as variable "states"
with column role "name"
.
R6::R6Class inheriting from TaskClust.
mlr_tasks$get("usarrests") tsk("usarrests")
This object wraps the predictions returned by a learner of class LearnerClust, i.e. the predicted partition and cluster probability.
mlr3::Prediction
-> PredictionClust
partition
(integer()
)
Access the stored partition.
prob
(matrix()
)
Access to the stored probabilities.
new()
Creates a new instance of this R6 class.
PredictionClust$new( task = NULL, row_ids = task$row_ids, partition = NULL, prob = NULL, check = TRUE )
task
(TaskClust)
Task, used to extract defaults for row_ids
.
row_ids
(integer()
)
Row ids of the predicted observations, i.e. the row ids of the test set.
partition
(integer()
)
Vector of cluster partitions.
prob
(matrix()
)
Numeric matrix of cluster membership probabilities with one column for each cluster
and one row for each observation.
Columns must be named with cluster numbers, row names are automatically removed.
If prob
is provided, but partition
is not, the cluster memberships are calculated from
the probabilities using max.col()
with ties.method
set to "first"
.
check
(logical(1)
)
If TRUE
, performs some argument checks and predict type conversions.
clone()
The objects of this class are cloneable with this method.
PredictionClust$clone(deep = FALSE)
deep
Whether to make a deep clone.
library(mlr3) library(mlr3cluster) task = tsk("usarrests") learner = lrn("clust.kmeans") p = learner$train(task)$predict(task) p$predict_types head(as.data.table(p))
library(mlr3) library(mlr3cluster) task = tsk("usarrests") learner = lrn("clust.kmeans") p = learner$train(task)$predict(task) p$predict_types head(as.data.table(p))
This task specializes mlr3::Task for cluster problems.
As an unsupervised task, this task has no target column.
The task_type
is set to "clust"
.
Predefined tasks are stored in the dictionary mlr_tasks.
mlr3::Task
-> mlr3::TaskUnsupervised
-> TaskClust
mlr3::Task$add_strata()
mlr3::Task$cbind()
mlr3::Task$data()
mlr3::Task$droplevels()
mlr3::Task$filter()
mlr3::Task$format()
mlr3::Task$formula()
mlr3::Task$head()
mlr3::Task$help()
mlr3::Task$levels()
mlr3::Task$missings()
mlr3::Task$print()
mlr3::Task$rbind()
mlr3::Task$rename()
mlr3::Task$select()
mlr3::Task$set_col_roles()
mlr3::Task$set_levels()
mlr3::Task$set_row_roles()
new()
Creates a new instance of this R6 class.
TaskClust$new(id, backend, label = NA_character_)
id
(character(1)
)
Identifier for the new instance.
backend
(DataBackend)
Either a DataBackend, or any object which is convertible to a DataBackend with as_data_backend()
.
E.g., a data.frame()
will be converted to a DataBackendDataTable.
label
(character(1)
)
Label for the new instance.
clone()
The objects of this class are cloneable with this method.
TaskClust$clone(deep = FALSE)
deep
Whether to make a deep clone.
library(mlr3) library(mlr3cluster) task = TaskClust$new("usarrests", backend = USArrests) task$task_type # possible properties: mlr_reflections$task_properties$clust
library(mlr3) library(mlr3cluster) task = TaskClust$new("usarrests", backend = USArrests) task$task_type # possible properties: mlr_reflections$task_properties$clust