Skip to content

rsquaredata/mmrClustVar

Repository files navigation

mmrClustVar

R package implementing multiple variable clustering algorithms (numeric, categorical, mixed), with an R6-based architecture, interpretability tools, and an interactive Shiny app.


Overview

mmrClustVar is an academic R package developed as part of the Master 2 SISE (Statistics & Computer Science for Data Science) at Université Lyon 2.

It provides:

  • k-means (numeric)
  • k-modes (categorical)
  • k-prototypes (mixed)
  • k-medoids (general)
  • Automatic/assisted selection of K
  • Interpretability tools (inertia, adhesion, profiles)
  • Shiny application for exploration
  • Full export functionalities

Repository Structure

mmrClustVar/
├── DESCRIPTION
├── NAMESPACE
├── R/
│   ├── Interface.R
│   ├── ClusterBase.R
│   ├── Kmeans.R
│   ├── Kmodes.R
│   ├── Kprototypes.R
│   ├── Kmedoids.R
│   ├── run_app.R
│   └── metal_universe.R
├── inst/shiny/mmrClustVar_app/
├── data/
├── data-raw/prepare_datasets.R
└── README.md

Installation

# install remotes if not already installed
install.packages("remotes")
# install directly from GitHub
remotes::install_github("rsquaredata/mmrClustVar")
# import library
library(mmrClustVar)

Quick Start — Using the R6 Class

1. Fit

df <- iris[,1:4]

obj <- Kmeans$new(
  K=3,
  scale=TRUE
)

obj$fit(df)

2. Summary

obj$summary()

3. Clusters & Centers

obj$get_clusters()
obj$get_centers()
obj$get_inertia()

4. Predict New Variables

obj$predict(df[,1,drop=FALSE])

5. Plots

obj$plot("clusters")
obj$plot("inertia")
obj$plot("membership")
obj$plot("profiles")

6. Inertia Path

obj$compute_inertia_path(K_seq=2:6, X=df)
obj$plot("inertia")

Using the Shiny App

run_mmrClustVar_app()

Features:

  • Import datasets or upload CSV/XLSX
  • Select active/supplementary variables
  • All algorithms available
  • Diagnostics + plots
  • Export clusters, summary, full ZIP bundle

References


Authors

  • Marin Nagy
  • Mazilda Zehraoui
  • Rina Razafimahefa

License

MIT License

About

R package implementing multiple variable clustering algorithms (quantitative, qualitative, mixed), with R6-based architecture, interpretability tools, and an interactive Shiny app for visual exploration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages