Methods for Clustering Mixed-Type Data

Implements methods for clustering mixed-type data, specifically combinations of continuous and nominal data. Special attention is paid to the often-overlooked problem of equitably balancing the contribution of the continuous and categorical variables. This package implements KAMILA clustering, a novel method for clustering mixed-type data in the spirit of k-means clustering. It does not require dummy coding of variables, and is efficient enough to scale to rather large data sets. Also implemented is Modha-Spangler clustering, which uses a brute-force strategy to maximize the cluster separation simultaneously in the continuous and categorical variables. For more information, see Foss, Markatou, Ray, & Heching (2016) and Foss & Markatou (2018) .


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:

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.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("kamila")

0.2.0 by Alexander Foss, a month ago


https://github.com/ahfoss/kamila


Report a bug at https://github.com/ahfoss/kamila/issues


Browse source code at https://github.com/cran/kamila


Authors: Alexander Foss [aut, cre] , Marianthi Markatou [aut]


Documentation:   PDF Manual  


GPL-3 | file LICENSE license


Imports stats, parallel, KernSmooth, Rcpp

Suggests testthat, withr, xml2, shiny, cluster, clustMixType, clustrd, VarSelLCM, flexmix, mvtnorm, mclust, mixtools, MASS, pkgload, covr

Linking to Rcpp


See at CRAN