Distance-Based Learning for Mixed-Type Data
Overview
Provides tools for constructing, computing, and using distance measures for numerical, categorical, and mixed-type data. The package implements a flexible framework in which continuous and categorical components can be combined under additive, commensurable, and association-aware specifications. Supported methods include classical distances such as Gower, Euclidean, Manhattan, and Mahalanobis-type distances; categorical dissimilarities such as simple matching, occurrence-frequency, and association-based measures; and mixed-type presets designed to reduce biases due to variable type, scale, distribution, redundancy, and number of categories. The package also provides scaling options, supervised and unsupervised distance constructions, leave-one-variable-out tools for distance-based variable importance, and integration with distance-based learning workflows such as nearest-neighbour prediction, partitioning around medoids, and spectral clustering. Methods are motivated by van de Velden, Iodice D'Enza, Markos, and Cavicchia (2026) doi:10.1080/10618600.2026.2680181 and related work on categorical and mixed-type dissimilarities.
Benchmarking and diagnostics
- Extended
benchmark_mdist()to compare every pair of successful distance specifications using mean absolute distance differences, symmetric relative distance, multidimensional-scaling congruence, and alienation. - Added optional clustering comparisons to
benchmark_mdist(). Supplyingcluster_kcomputes pairwise adjusted Rand indices for PAM, hierarchical, and/or spectral clustering; clustering is skipped whencluster_k = NULL. - Added
benchmark_comparisons()to extract the pairwise diagnostics stored in anMDistBenchmarkresult without recomputing the distances. - Added an
autoplot()method forMDistBenchmarkobjects, with annotated heatmaps for distance, geometry, and clustering-agreement diagnostics.
Distance construction and recipe workflows
Show all changes in 0.5.1Hide the rest of the changes in 0.5.1
- Updated
step_mdist()so response-aware specifications can obtain a single outcome directly from the recipe formula during preparation. The fitted response-aware profiles are reused when new data are baked, so assessment and test outcomes are neither required nor used. - Added the
response_usedargument tostep_mdist(), allowing response use to be disabled explicitly. - Allowed
method_numto override the default standardization of the"euclidean"preset for numerical-only data. In particular,method_num = "none"computes ordinary Euclidean distances on the original variables.
Data
- Added
wdi_2022, a documented snapshot of selected 2022 World Development Indicators for reproducible mixed-type distance examples.
Documentation and testing
- Added focused tests for response-aware
step_mdist()workflows and the pairwise benchmarking interface. - Expanded the package website with task-oriented articles on distance construction, diagnostics and benchmarking, clustering, and nearest-neighbour workflows.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 23 (1 internal)
- Examples that run
- 73%11 run in a plain check (5 of them under a condition) · 4 never run
- Exported functions with examples
- 68%
- Documented parameters
- 100%
- Return-value docs
- 95%
- Help pages citing references
- 9%
Downloads
Repository
Commits over time
4 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/alfonsoiodicede/manydist_package on 2026-10-22.
GitHub Pages site last deployed 2026-10-19 · The repository has a site deploy workflow
Dependencies
Installing manydist adds 132 packages (66 with compiled code, 91 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.
Code & Tests
Datasets
People & History
Previously maintained by Angelos Markos (0.4.3 to 0.4.9).
Pick two releases to compare their code metrics.
- 0.5.1Latest2026-07-23 · current release · diff ↗ ·
added 6 exports
all_dist_method_specs, benchmark_comparisons, benchmark_mdist, dist_methods_tbl, dist_methods_tbl_cat, response_aware_methods - 0.5.02026-06-09 · diff ↗ ·
removed 2 exports
cdist, ndistadded 16 exports
compare_lovo_mdist, congruence_coeff, fit_knn_dist, gen_mixed, generate_dataset, lovo_mdist, lovo_method_spec, make_mdist_recipe, nearest_neighbor_dist, pam_dist, predict_knn_dist_class, predict_knn_dist_prob, predict_knn_dist_reg, spectral_dist, spectral_from_dist, step_mdist - RR 4.6.0 released · 2026-04-24
- 0.4.92026-02-04 · diff ↗
- 0.4.82025-07-18 · diff ↗
- 0.4.72025-07-08 · diff ↗
- 0.4.52025-07-02 · diff ↗
- 0.4.42025-06-23 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.4.32025-02-12
- RR 4.4.0 released · 2024-04-24
Package metadata
- First published
- 2025-02-12
- Total releases
- 8 / 1 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.5.0
- Bundled data
- 16 KB / 2 files
- Download size
- 2.0 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("manydist")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.1080/10618600.2026.2680181.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.