mlr3cluster 0.5.0
CRAN release: 2026-08-21
New learners
-
clust.gmeans: G-means clustering from the gmeans package, which extends k-means by automatically determining the number of clusters. -
clust.kmeans_rcpp: K-means clustering viaClusterR::KMeans_rcpp()from the ClusterR package. -
clust.kmodes: K-modes clustering for categorical data from the klaR package.
New measures
-
clust.sse_ratio: Within-cluster sum of squares divided by total sum of squares, a normalized measure of cluster compactness.
Other improvements
-
clust.cobwebnow exposes theoutput_debug_infoparameter, matching the other RWeka-based learners. -
clust.cobweb,clust.em,clust.ff, andclust.SimpleKMeansnow support marshaling. -
clust.kccanow exposes simulated annealing throughclassify = "simann"and thesimannparameter. -
clust.meanshiftnow predicts on new data. It runs mean shift from each observation with the bandwidth and convergence threshold used for training, then assigns the observation to the mode it reaches. Previously, prediction warned and returned the training partition. -
clust.movMFnow exposes theidsparameter, which initializes the EM algorithm from fixed component memberships. -
clust.protoclustnow predicts on new data by assigning each observation to the cluster with the nearest prototype. Previously, prediction warned and returned the training partition. Its model now stores the fitted object and training data in a list. -
clust.skmeansnow exposesstartfor selecting the initialization andmaxchainsfor the"pclust"and"LIHC"methods. -
clust.stdbscannow supports observation weights throughweights, matchingclust.dbscan.
Bug fixes
- Clustering measures now handle character features consistently with factor and ordered features. Distance-based measures use Gower distances instead of treating character values as missing, while measures that require numeric features report an informative error.
-
as_prediction_clust()now converts whole-numberedpartitionvalues to integers instead of rejecting them. -
clust.agnes,clust.diana,clust.genie, andclust.hclustnow validatekagainst the number of training observations when predicting. They previously used the number of rows in the new data even thoughcutree()cuts the training tree. -
clust.apnow breaks similarity ties deterministically when predicting, matching the assignment rule of the apcluster package. -
clust.apno longer fails to train on tasks with a feature namedm. -
clust.bicoandclust.kccanow requirek >= 2, matching their existing training requirements. Invalid values now fail when set rather than during training. -
clust.claraandclust.pamnow reject prediction when trained withstand = TRUE, becauseclue::cl_predict()would otherwise assign clusters using unstandardized new data. -
clust.cmeansnow returns a plain probability matrix withoutclue’s internal attributes. -
clust.cobweb,clust.ff, andclust.xmeansnow allow the seedS = 0, which Weka accepts, matching the seed bound ofclust.emandclust.SimpleKMeans. -
clust.dbscan_fpcnow rejects prediction when trained withscale = TRUE. This prevents comparisons between unscaled new data andeps, which applies to the scaled training data. -
clust.hclustandclust.protoclustnow require the Minkowski powerpto be greater than 0, matchingstats::dist(). -
clust.hdbscannow requiresminPts >= 2, matchingdbscan::hdbscan(). Smaller values now fail when set rather than during training. -
clust.kccanow validatesinitcentas a single string and documents its default as"randomcent". Invalid values now fail when set rather than producing an obscure S4 validity error during training. -
clust.kccano longer exposes thentryandmin.sizeparameters, which areflexclust::qtclust()control options thatflexclust::kcca()ignores. -
clust.kkmeansnow resolves prediction distance ties with"first"instead of"random", so predictions are reproducible without setting a seed. -
clust.mclustnow stores$assignmentsas an integer vector, consistent with the other learners, instead of the double vector returned by mclust. -
clust.optics,clust.som, andclust.tclustnow coerce logical features to numeric, so tasks with only logical features train and predict instead of erroring in the upstream packages. -
clust.SimpleKMeansnow declaresmin_densityas a nonnegative double instead of a positive integer, since Weka accepts fractional canopy densities. -
PredictionClustnow preserves measure weights from tasks with aweights_measurecolumn in$weightsandas.data.table()instead of dropping them. -
PredictionClustnow errors during construction when a partition label has no matchingprobcolumn, instead of silently accepting inconsistent predictions.
mlr3cluster 0.4.1
CRAN release: 2026-07-10
Bug fixes
-
clust.agnes,clust.diana,clust.genie,clust.hclust, andclust.protoclustnow cut the tree at the currentkwhen predicting, so changingkbetween training and prediction takes effect. -
clust.apno longer errors when affinity propagation finds a single cluster. -
clust.biconow reclusters the BICO coreset with k-means viastream::DSC_TwoStage(), sokdetermines the number of predicted clusters instead of returning the raw micro-clusters. Training warns when the coreset is too small to producekclusters. -
clust.claranow errors informatively when predicting withmetric = "jaccard"ormedoids.x = FALSEinstead of failing with an obscure upstream error. -
clust.dbscan_fpcnow errors informatively when predicting after training withseeds = FALSEinstead of failing with an obscure upstream error. -
clust.flexmixnow trains viaflexmix::stepFlexmix(), sonrepactually runs repeated EM initializations and keeps the best fit instead of being silently ignored. Settingnreptogether withclusternow errors. -
clust.genie,clust.kkmeans, andclust.kprotonow error informatively during training when the task has fewer than 2 features, which the upstream implementations cannot handle. -
clust.kkmeansnow predicts by assigning observations to the nearest cluster centroid in the kernel-induced feature space, since input-space distances produced wrong assignments for nonlinear kernels. The model is now a list with the fitted object, training data, and per-cluster kernel statistics. -
clust.movMFnow derives the stored$assignmentsfrom the predict method, so predicting on the training data yields the training assignments. -
clust.somnow predicts and derives the stored$assignmentsviakohonen::map(), so models trained withkeep.data = FALSEno longer fail at predict or store empty assignments. -
clust.stdbscannow errors during training when the task does not have exactly 3 features (two spatial coordinates and one temporal coordinate) instead of silently using the wrong columns. -
clust.tclustno longer exposes theiter.maxparameter, which is deprecated in tclust 2.0 in favor ofniter1,niter2, andnkeep. -
clust.wssandclust.entropynow returnNaNinstead of 0 for empty predictions, which forclust.wsssilently skewed aggregated resampling scores. -
PredictionClust: combined and empty prediction data now retain thePredictionDataclass, soresample()no longer errors on resampling iterations with an empty test set. -
PredictionClust: when the partition is derived from a probability matrix, it now uses the cluster labels from the column names instead of the column positions. -
PredictionClust: empty prob predictions now combine with non-empty ones without error and no longer serialize a spuriousprob.V1column viaas.data.table(). -
PredictionClust:as.data.table()no longer drops the partition column for prob-only predictions constructed withcheck = FALSE, returningNApartitions instead.
mlr3cluster 0.4.0
CRAN release: 2026-06-11
New learners
-
clust.flexmix: Finite mixture model clustering from the flexmix package. -
clust.genie: Genie hierarchical clustering from the genieclust package. -
clust.kcca: K-centroids cluster analysis from the flexclust package, supporting k-means, k-medians, spherical, Jaccard, and extended Jaccard families. -
clust.movMF: Von Mises-Fisher mixture clustering from the movMF package. -
clust.skmeans: Spherical k-means clustering from the skmeans package. -
clust.som: Self-organizing maps from the kohonen package. -
clust.stdbscan: ST-DBSCAN spatio-temporal clustering from the stdbscan package (#83). -
clust.tclust: Robust trimmed clustering from the tclust package.
New measures
-
clust.avg_between: Average between-cluster distance. -
clust.avg_within: Average within-cluster distance. -
clust.davies_bouldin: Davies-Bouldin index. -
clust.dunn2: Alternative Dunn index using average distances. -
clust.entropy: Cluster size distribution entropy. -
clust.pearsongamma: Pearson Gamma correlation between distances and cluster membership. -
clust.wb_ratio: Within/between distance ratio.
Other improvements
- Learners no longer store the training data or dissimilarity matrix in the model by default:
clust.agnes,clust.diana,clust.fanny, andclust.pamnow exposekeep.dissandkeep.data,clust.claraandclust.kprotoexposekeep.data, andclust.apexposesincludeSim, all initialized toFALSE. Set the respective parameter toTRUEto restore the previous behavior. - Clustering quality measures
clust.ch,clust.dunn, andclust.wssare now computed natively instead of relying onfpc::cluster.stats(). The fpc package is no longer a hard dependency. -
clust.cobweb,clust.em,clust.ff,clust.SimpleKMeans, andclust.xmeansnow declare themissingsproperty, since Weka handles missing attribute values natively. -
clust.dianagains thestop.at.kparameter fromcluster::diana(). -
clust.emdrops theexclusiveproperty andclust.MBatchKMeansdropsfuzzy. Use theprobpredict type to select learners with soft memberships.
Bug fixes
-
mlr3clusteris now added tomlr_reflections$loaded_packagesto fix errors when using the package in parallel. -
as_prediction_clust.data.frame()no longer errors withunused argument (with = FALSE)when given a plaindata.frame. -
clust.cmeansnow reports a proper error message when an invalidweightsvalue is given instead of failing with a type error. -
clust.cmeans,clust.kkmeans, andclust.kmeansnow accept a matrix of initial cluster centers for thecentersparameter, matching the upstream functions. -
clust.cobwebnow declares thehierarchicalproperty instead ofpartitional, andclust.meanshiftdeclaresdensityinstead ofpartitional. -
clust.dbscan,clust.dbscan_fpc,clust.hdbscan, andclust.opticsnow declare thepartialproperty instead ofcomplete, since these algorithms can leave observations unassigned (noise points labeled 0). -
clust.featurelessnow returnsprobpredictions whose most probable cluster matches the predictedpartition, with cluster column names consistent with the other learners supporting theprobpredict type. -
clust.silhouettenow returnsNaNinstead of0when all observations belong to a single cluster, since the silhouette width is undefined for k < 2.
mlr3cluster 0.3.0
CRAN release: 2026-03-01
- feat: Add CLARA clustering learner
clust.clarafrom the cluster package. - feat: Add k-prototypes clustering learner
clust.kprotofrom the clustMixType package. - feat: Add spectral clustering learner
clust.speccfrom the kernlab package. - fix:
LearnerClustDBSCANfpcnow correctly passes thenewdataargument in the predict method. - fix:
LearnerClustKKMeansnow correctly passes kernel parameters via thekparlist tokernlab::kkmeans(). - fix:
clust.silhouettemeasure now has the correct range of[-1, 1]. - docs: Fix typos in measure documentation.
mlr3cluster 0.2.0
CRAN release: 2026-02-04
- feat:
Mlr3ErrorandMlr3Warningclasses for errors and warnings. - feat: Add protoclust learner from the protoclust package.
- feat: EM learner now supports probabilistic assignments.
- fix: Update learner parameter sets to match upstream package changes.
- docs: Documentation improvements.
- chore: mlr3cluster now requires R 3.4.0. Following data.table’s minimum R version.
- chore: mlr3cluster now requires mlr3 (>= 1.3.0) and mlr3misc (>= 0.19.0).
mlr3cluster 0.1.12
CRAN release: 2025-11-19
- feat: Add
cluster_selection_epsilonparameter to HDBSCAN learner and initializeminPtsto 5. - docs: Better learner example section.
mlr3cluster 0.1.11
CRAN release: 2025-02-18
- fix: Mclust learner no longer sets the control default with a function not in import to stay compliant with paradox package conventions.
mlr3cluster 0.1.10
CRAN release: 2024-10-03
- feat: Add BIRCH learner from the stream package.
- feat: Add BICO learner from the stream package.
mlr3cluster 0.1.9
CRAN release: 2024-03-18
- feat: Add DBSCAN learner from the fpc package.
- feat: Add HDBSCAN learner from the dbscan package.
- feat: Add OPTICS learner from the dbscan package.
- chore: Compatibility with upcoming paradox release.
- chore: Move to testthat3.
- refactor: General code refactoring.
mlr3cluster 0.1.7
CRAN release: 2023-03-10
- chore: Replace ‘clusterCrit’ measures with alternatives from cluster and fpc packages.
- fix: Remove broken unloading test.
mlr3cluster 0.1.6
CRAN release: 2022-12-22
- feat: Add states as row names to
usarreststask. - fix: Remove dictionary items after unloading package.
mlr3cluster 0.1.5
CRAN release: 2022-11-01
- feat: Add Mclust learner.
- fix: Fix error associated with new dbscan release.
mlr3cluster 0.1.3
CRAN release: 2022-04-06
- feat: Add filter to
PredictionClust. - fix: Small bug fixes.
- refactor: General code refactoring.
mlr3cluster 0.1.2
CRAN release: 2021-09-02
- feat: Add Hclust learner.
- feat: Add within sum of squares measure.
- docs: Add tests and documentation for Hclust.
- docs: Add documentation for WSS measure.
- refactor: Code factor adaptations.
