Giter Club home page Giter Club logo

mcap's Introduction

Build Status

MCAP

mcap provides a model-based clustering approach in very high dimensions (especially when p is much larger than n) via adaptive projections. Clustering is based on full variances Gaussian mixture modelling in a lower dimensional (projected) space. The projection dimension is set adaptively in a data-driven manner based on a cluster stability criterion. Available projection variants (so far) include PCA and random Projections (Gaussian as well as sparse methods).

Resources

See our paper: currently under review

preprint: โ€ฆ

Getting Started

Clone or download the code from github.

Alternatively, you can install mcap directly from github with:

# install.packages("devtools")
devtools::install_github("btaschler/mcap")

Prerequisites

Dependencies on other packages:

  • for parallelisation: foreach, doParallel, parallel

  • for clustering: pcaMethods, nethet, mclust, RandPro, kernlab

  • misc: iterators, magrittr, stats, dplyr, tidyverse, utils, methods, data.table, RevoUtilsMath

Quick demo

This is a basic example showing how to use mcap to cluster two (known) groups:

library(mcap)

### basic example code
K <- 2       #number of clusters (groups)
n_k <- 200   #number of samples per group
p <- 1000    #number of features (dimension)
A <- matrix(rnorm(n_k*p), n_k, p)            #data for group 1
B <- matrix(rnorm(n_k*p, mean = 1), n_k, p)  #data for group 2
X <- rbind(A, B)                   #input matrix
Y <- c(rep(0, n_k), rep(1, n_k))   #known labels
           
## using PCA projections
model_fit <- MCAPfit(X, k = K, projection = 'PCA', centering_per_group = FALSE,
                     true_labels = Y, parallel = TRUE)

## sparse random projection
model_fit <- MCAPfit(X, k = K, projection = 'li', centering_per_group = FALSE,
                     true_labels = Y, parallel = TRUE)

## adjusted Rand index
print(model_fit$fit_gmm$aRI)

## display assigned cluster labels for each sample
print(model_fit$fit_gmm$model_fit$comp)

## show optimised projection dimension
print(model_fit$fit_q_opt$q_opt)

Versioning

For all available versions, see releases. We use Semantic Versioning.

Authors

List of contributors.

License

This project is licensed under the GNU General Public License โ€“ see the GPL-3.0 for details.

Acknowledgments

mcap's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

unoe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.