Cluster Extension for 'mlr3'
Overview
Extends the 'mlr3' package with cluster analysis.
Breaking changes
clust.ap,clust.dbscan,clust.dbscan_fpc,clust.hdbscan,clust.meanshift,clust.optics, andclust.stdbscannow store$modelas a list. Use$native_modelfor the fitted upstream object (#129).clust.dbscan_fpcno longer offersmethod = "dist", which treated the features as a distance matrix and either failed or returned wrong clusters.clust.dianano longer exposesstop.at.k, whichcluster::diana()ignores since only the defaultFALSEis implemented.clust.flexmixnow uses the upstream defaultnrep = 3, which runs the EM algorithm three times and keeps the best fit. Setnrep = 1to restore the previous behavior.clust.kkmeansnow only acceptspwithalg = "kerninghan", andclust.kmeans_rcppandclust.MBatchKMeansnow only accepttol_optimal_initwithinitializer = "optimal_init", since the upstream functions ignore them otherwise.clust.kprotonow treats logical features as categorical, so a vector-valuedlambdamust include an entry for each logical feature.tgen("moons")returns the classification task generator from mlr3 again. mlr3cluster 0.6.0 had replaced it with a clustering version, which has been removed. Useas_task_clust(tgen("moons")$generate(n))to create a clustering task (#128).
New features
as_task_clust()now converts aTaskClassiforTaskRegrto aTaskClustby dropping the target from the features. This creates cluster tasks from any task generator in mlr3, e.g.as_task_clust(tgen("spirals")$generate(n)).
Other improvements
clust.cobweb,clust.em,clust.ff, andclust.SimpleKMeansnow support factor and ordered features, which Weka handles as nominal attributes.
Show all changes in 0.7.0Hide the rest of the changes in 0.7.0
clust.flexmixno longer requiresk, so unsetting it infers the number of components fromcluster.clust.kmeans_rcppandclust.MBatchKMeansnow check thatCENTROIDSis a matrix when it is set, instead of failing inClusterRduring training.clust.tclustnow supports the Gaussian parsimonious clustering models viarestr = "GPCM"and the newparsparameter.LearnerClust$save_assignmentsnow checks that it is set to a singleTRUEorFALSE.
Bug fixes
clust.apnow predicts with the similarity functionsused for training, which it stores in the model.clust.apcan now predict with a similarity functionsthat has noselargument, e.g.function(x) -as.matrix(dist(x))^2. Previously, training worked but predicting failed.clust.clara(metric,medoids.x, andstand),clust.dbscan_fpc(scaleandseeds), andclust.pam(stand) now use the training values for prediction checks. Changing these parameters after training no longer bypasses the checks or incorrectly prevents prediction.clust.cmeansnow accepts zeroweights, as long as at least one weight is positive, matchinge1071::cmeans().clust.cmeans,clust.kkmeans,clust.kmeans,clust.kmeans_rcpp,clust.kproto, andclust.MBatchKMeansnow match initial cluster centers to the task features by column name instead of by position.clust.cobweb,clust.em,clust.ff,clust.kmodes,clust.kproto, andclust.SimpleKMeansnow treat logical features as categorical. Previously, they could be ignored or encoded differently in training and prediction.clust.dbscan_fpcnow accepts whole-number doubles such asc(10, 20)forcountmode. Previously, only integer vectors were accepted.clust.featurelessnow predicts with thenum_clustersused for training.clust.meanshiftnow predicts with the convergence parametersthranditerused for training, which it stores in the model.clust.optics,clust.skmeans,clust.stdbscan, andclust.tclustnow reject hyperparameter values that always fail upstream:minPts = 0forclust.optics, negativeapproxforclust.opticsandclust.stdbscan,method = "kmndirs"forclust.skmeans, andtracevalues above 1 forclust.tclust.clust.protoclustnow predicts with the distance parametersmethod,diag,upper, andpused for training, which it stores in the model.clust.silhouettenow returnsNaNinstead of an error when every observation is in its own cluster, e.g. for small test sets in resampling.clust.speccnow uses the selectedkernelwhen no kernel parameters are set. Previously, it always used an RBF kernel with an estimatedsigmain this case.clust.xmeansnow initializesCto 0.5 so that it is always passed to Weka. Previously, Weka resetCto 0 whenever any other parameter was set.
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-15
- ERROR12 OK, 1 ERROR2026-09-25
- OK13 OK2026-09-21
- ERROR12 OK, 1 ERROR2026-09-20
- OK13 OK2026-08-05
Show 4 earlier changesHide 4 earlier changes
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-08
- NOTE12 OK, 1 NOTE2026-06-07
- OK14 OK2026-03-10
Documentation
- Help pages
- 61includes a package overview page
- Examples that run
- 100%45 run in a plain check (40 of them under a condition)
- Exported functions with examples
- 98%
- Documented parameters
- 75%
- Return-value docs
- 4%
- Help pages citing references
- 74%
Downloads
Repository
- PRs merged (all time)
- 92%
- Median days to close, 50 most recently updated closed issues
- 29
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
16 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/mlr-org/mlr3cluster on 2026-10-21.
The R CMD check workflow runs on Linux, and on R-devel
Funding links: GitHub Sponsors
The repository owner accepts GitHub Sponsors
GitHub Pages site last deployed 2026-10-18 · The repository has a site deploy workflow
pkgdown site last built 2026-10-18
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-02-04Named in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: .claudePull request it wrote: opened by a project memberCommits: at least 1 crediting it in the message
- Gemini CLIfirst seen on or before 2026-07-18Config: a file or ignore line, not recorded which
- Cursorfirst seen 2026-08-17Named in .Rbuildignore: .cursor
- Claude Opus 51 commit · Sep 2026
Dependencies
Installing mlr3cluster adds 24 packages (11 with compiled code, 16 MB of source tarballs). Heaviest: data.table 5.7 MB, palmerpenguins 2.9 MB, mlbench 967 KB.
Code & Tests
People & History
Previously maintained by Damir Pulatov (0.1.0 to 0.1.10).
Pick two releases to compare their code metrics.
- 0.7.0Latest
- 0.6.0
- 0.5.0
- 0.4.12026-07-10 · diff ↗
- 0.4.02026-06-11 · diff ↗ ·
added 8 exports
LearnerClustFlexmix, LearnerClustGenie, LearnerClustKCCA, LearnerClustMovMF, LearnerClustSKMeans, LearnerClustSOM, LearnerClustSTDBSCAN, LearnerClustTclust - RR 4.6.0 released · 2026-04-24
- 0.3.0
- 0.2.0
- 0.1.122025-11-19 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.1.112025-02-19 · diff ↗
- 0.1.10
- RR 4.4.0 released · 2024-04-24
- 0.1.9
- RR 4.3.0 released · 2023-04-21
- 0.1.82023-03-12 · diff ↗
Show 11 earlier eventsHide 11 earlier events
- 0.1.72023-03-10 · diff ↗
- 0.1.62022-12-22 · diff ↗
- 0.1.5
- 0.1.42022-08-14 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.1.32022-04-06 · diff ↗
- 0.1.2
- RR 4.1.0 released · 2021-05-18
- 0.1.12020-11-16 · diff ↗ ·
added 8 exports
LearnerClustAP, LearnerClustCobweb, LearnerClustEM, LearnerClustFarthestFirst, LearnerClustKKMeans, LearnerClustMeanShift, LearnerClustMiniBatchKMeans, LearnerClustSimpleKMeans - 0.1.02020-10-01
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2020-10-01
- Total releases
- 20 / 6 yrs
- License
- LGPL-3 OSI
- Minimum R
- ≥ 3.5.0
- Download size
- 274 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("mlr3cluster")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.