Skip to content

An intuitive implementation of spectral clustering on matlab

Notifications You must be signed in to change notification settings

jhliu17/spectral-clustering.matlab

Repository files navigation

Spectral Clustering with MatLab

This is an intuitive implementation of Spectral Clustering with MATLAB. You can easily finish a spectral clustering analysis using Scikit-Learn similar API (the comparison between spectral clutsering and other clustering methods can be found here). For more deatils about spectiral clustering, you can read the references below or a brief introduction written by us.

Getting Started

  1. Clone this repo and run main.m to see the demo
  2. Usage Details
  • Specify your data matrix X and label vector y, or get the built-in data

    [X, y] =  make_digits_dataset(300, true, false); % 300 examples, balance, no shuffle
    

    In this project, we provide 6 datasets including 3 toys and 3 real datasets. You can find them in datasets.

  • Construct your graph

    W = fullyconnected(X, 7.8, 'rbf');
    

    There havs 3 types of graph you can use. Find them in graph.

  • Run the Spectral Clustering Solver

    [C, ~] = SpectralClustering(W, size(unique(y), 1), 2);
    

    C is the predicted clusters.

  • You can also easily metric the predicted answer with the functions under the metric.

Contributors

  • Junhao Liu
  • Jinlai Nin
  • Dedong Huang
  • Hao Wen

Reference

  1. Von Luxburg, Ulrike. "A tutorial on spectral clustering." Statistics and computing 17.4 (2007): 395-416.

About

An intuitive implementation of spectral clustering on matlab

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published