kamila CRAN Version License: GPL v3 R-CMD-check test-coverage Codecov test coverage lint Shinylive App CRAN_Status_Badge CRAN_Status_Badge

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.

Installation

Stable CRAN Release

install.packages("kamila")

Development Version

# install.packages("remotes")
remotes::install_github("ahfoss/kamila")

Quick Start

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)

Scientific Publications

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.

Updates & Release News

For release notes and version history, see NEWS.md.

[Under Construction] Interactive Clustering Horse-Race App

Explore and benchmark KAMILA against competing mixed-type clustering algorithms (FlexMix, PAM + Gower’s distance, k-prototypes, VarSelLCM) interactively:

🚀 Launch Live Web App (Client-Side WebAssembly)

No installation required: Runs 100% client-side in your web browser via WebR & Shinylive.


Run Locally in R

To run the dashboard locally:

shiny::runGitHub(
  repo = "kamila",
  username = "ahfoss",
  ref = "master",
  subdir = "inst/shiny/horserace"
)

Performance Benchmarking & Superiority Testing

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.