kamila implements methods for clustering mixed-type data
(continuous and nominal categorical variables), specifically
KAMILA (KA-means for MIXed LArge datasets) and
Modha-Spangler clustering. Special attention is paid to
the problem of equitably balancing the contribution of continuous and
categorical variables without requiring artificial dummy coding.
install.packages("kamila")# install.packages("remotes")
remotes::install_github("ahfoss/kamila")library(kamila)
# Generate synthetic mixed-type data (continuous + categorical)
set.seed(123)
dat <- genMixedData(
sampSize = 200,
nCon = 3,
nCat = 2,
nClust = 3,
nIndepConCat = 0
)
# Run KAMILA clustering (e.g., K = 3 clusters with 5 random initializations)
kamRes <- kamila(
conVar = dat$conVars,
catFactor = dat$catVars,
numClust = 3,
numInit = 5
)
# Inspect cluster assignments
table(True = dat$trueID, Predicted = kamRes$finalMemb)For an in-depth discussion of the challenges involved in clustering mixed-type data, please see: * Foss, Markatou, Ray, and Heching (2016). A semiparametric method for clustering mixed data. Machine Learning, 105(3), 419-458. DOI: 10.1007/s10994-016-5575-7 * Foss and Markatou (2018). kamila: Clustering Mixed-Type Data in R and Hadoop. Journal of Statistical Software, 83(13). DOI: 10.18637/jss.v083.i13 * Foss, Markatou, and Ray (2018). Distance Metrics and Clustering Methods for Mixed-Type Data. International Statistical Review. DOI: 10.1111/insr.12274.
For release notes and version history, see NEWS.md.
Explore and benchmark KAMILA against competing mixed-type clustering algorithms (FlexMix, PAM + Gower’s distance, k-prototypes, VarSelLCM) interactively:
No installation required: Runs 100% client-side in your web browser via WebR & Shinylive.
To run the dashboard locally:
shiny::runGitHub(
repo = "kamila",
username = "ahfoss",
ref = "master",
subdir = "inst/shiny/horserace"
)For contributors proposing algorithmic speedups, kamila
includes a statistical superiority testing framework. For details on how
to run local benchmarks or trigger CI via PR labels, see
SUPERIORITY_TESTING.md.