mlr3cluster

Cluster analysis for mlr3

mlr3cluster is an extension package for cluster analysis within the mlr3 ecosystem. It is a successor of clustering capabilities of mlr2.

Installation

Install the last release from CRAN:

install.packages("mlr3cluster")

Install the development version from GitHub:

devtools::install_github("mlr-org/mlr3cluster")

Feature Overview

The current version of mlr3cluster contains:

  • A selection of 22 clustering learners that represent a wide variety of clusterers: partitional, hierarchical, fuzzy, etc.
  • A selection of 4 performance measures
  • Two built-in tasks to get started with clustering

Also, the package is integrated with mlr3viz which enables you to create great visualizations with just one line of code!

Cluster Analysis

Cluster Learners

IDLearnerPackage
clust.agnesAgglomerative Hierarchical Clusteringcluster
clust.apAffinity Propagation Clusteringapcluster
clust.cmeansFuzzy C-Means Clusteringe1071
clust.cobwebCobweb Clustering AlgorithmRWeka
clust.dbscanDensity-based Clusteringdbscan
clust.dbscan_fpcDensity-based Clustering with fpcfpc
clust.dianaDivisive Hierarchical Clusteringcluster
clust.emExpectation-Maximization ClusteringRWeka
clust.fannyFuzzy Clusteringcluster
clust.featurelessSimple Featureless Clusteringmlr3cluster
clust.ffFarthestFirst Clustering AlgorithmRWeka
clust.hdbscanHDBSCAN Clusteringdbscan
clust.hclustAgglomerative Hierarchical Clusteringstats
clust.kkmeansKernel K-Means Clusteringkernlab
clust.kmeansK-Means Clusteringstats
clust.mclustGaussian Mixture Models-Based Clusteringmclust
clust.MBatchKMeansMini Batch K-Means ClusteringClusterR
clust.meanshiftMean Shift ClusteringLPCM
clust.opticsOPTICS Clusteringdbscan
clust.pamClustering Around Medoidscluster
clust.SimpleKMeansK-Means Clustering (WEKA)RWeka
clust.xmeansK-Means with Automatic Determination of kRWeka

Cluster Measures

IDMeasurePackage
clust.dunnDunn indexfpc
clust.chCalinski Harabasz Pseudo F-Statisticfpc
clust.silhouetteRousseeuw's Silhouette Quality Indexcluster
clust.wssWithin Sum of Squaresfpc

Example

library(mlr3)
library(mlr3cluster)

task = tsk("usarrests")
learner = lrn("clust.kmeans")
learner$train(task)
preds = learner$predict(task = task)

More Resources

Check out the blogpost for a more detailed introduction to the package. Also, mlr3book has a section on clustering.

Future Plans

  • Add more learners and measures
  • Integrate the package with mlr3pipelines (work in progress)

If you have any questions, feedback or ideas, feel free to open an issue here.

Copy Link

Version

Down Chevron

Install

install.packages('mlr3cluster')

Monthly Downloads

3,042

Version

0.1.9

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

March 18th, 2024

Functions in mlr3cluster (0.1.9)