View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Fast and efficient spectral clustering

4.8 | 9 ratings Rate this file 150 Downloads (last 30 days) File Size: 11.3 MB File ID: #34412 Version: 1.10
image thumbnail

Fast and efficient spectral clustering


Ingo (view profile)

  • 1 file
  • 4.77778


02 Jan 2012 (Updated )

Perform fast and efficient spectral clustering algorithms

| Watch this File

File Information

SpectralClustering performs one of three spectral clustering algorithms (Unnormalized, Shi & Malik, Jordan & Weiss) on a given adjacency matrix. SimGraph creates such a matrix out of a given set of data and a given distance function.

UPDATE 09/13/2012

This major update to the final version includes
[+] Full GUI
[+] Several Plot Options: 2D/3D, Star Coordinates, Matrix Plot
[+] Save Plots
[+] Save and Load all kind of data (pure data, similarity graph, clustered data)
[+] Differentiates between already labeled and unlabeled data (see README).

The code has been optimized (within Matlab) to be both fast and memory efficient. Please look into the files and the Readme.txt for further information.

- Ulrike von Luxburg, "A Tutorial on Spectral Clustering", Statistics and Computing 17 (4), 2007

If there are any questions or suggestions, I will gladly help out. Just contact me at admin (at) airblader (dot) de


Relativepath.M and Export Fig inspired this file.

Required Products Statistics and Machine Learning Toolbox
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (18)

It gives the following error when dataset is loaded. I loaded .csv file

Error using csvread (line 34)
File not found.

Error in guiMain>btnLoadData_Callback (line 51)
handles.Data = csvread(fullfile(relativepath(handles.PathName), ...

Error in gui_mainfcn (line 95)

Error in guiMain (line 18)
gui_mainfcn(gui_State, varargin{:});

Error in @(hObject,eventdata)guiMain('btnLoadData_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating uicontrol Callback

Please help

Comment only
27 Dec 2016 Zhou Yirong

16 Oct 2016 Oliver

Oliver (view profile)

It has a error when run it.

??? Error: File: D:\MATLAB7\work\SpectralClustering\files\GUI\guiMain.m Line: 22 Column: 38
Missing variable or function.
Error in ==> Main at 15
How should i do?

Comment only
08 Sep 2016 qiang shang

29 Jun 2016 Fanxing Ji

Thank you very much

10 Apr 2016 HBst

HBst (view profile)

24 Mar 2014 Toby Driscoll

Toby Driscoll (view profile)

19 Jul 2013 Ingo

Ingo (view profile)

  • 1 file
  • 4.77778

@Hanan That sure will be a test and I assume you need a good computer, but I think it should be possible. You would just have to test it, though.

Comment only
18 Jul 2013 Hanan Shteingart

does this package supports "large" datasets of 100,000 rows on 500 columns?

Comment only
02 Jul 2013 Javier

Javier (view profile)

This program fails on Matlab's Linux version since the relativepadth() function returns the relative path in lower letters.

The solution is to use an improved version of relativepath such as this one:

Comment only
18 Apr 2013 Charles Nelatury


02 Nov 2012 Ingo

Ingo (view profile)

  • 1 file
  • 4.77778

@BD Knight: Take a look at the SpectralClustering.m and the SimGraph_xxx.m files. Those are really all you need and they are well documented.

Comment only
02 Nov 2012 Eric T

Eric T (view profile)

Instructions on using command line? I need clustering embedded deeply in other tasks, multiple times, so using a GUI is not an option.

Comment only
04 Jul 2012 Ingo

Ingo (view profile)

  • 1 file
  • 4.77778

@leile: The code supports data with any dimension. By the way, a major update will be released as soon as I handed my thesis in. This will include a fully functional GUI.

Comment only
03 Jul 2012 leila

leila (view profile)

Does the code support 3d data?

Comment only
02 Jul 2012 Xiao

Xiao (view profile)

08 Feb 2012 Yo Yo

Yo Yo (view profile)

03 Feb 2012 Jeff H

Jeff H (view profile)

Nicely done; simple and efficient code.

03 Jan 2012 1.1

- Updated some files
- Included Demo

04 Jan 2012 1.3

Minor updates

08 Jan 2012 1.4

Got rid of redundant code

08 Jan 2012 1.5

fixed wrong code in demo file

13 Jan 2012 1.6

Fixed critical bug when creating sparse matrices

Demo now plots similarity graph (only use for few data points!)

Minor changes

19 Jan 2012 1.7

- Fixed critical mistake when creating similarity graphs

- Restructured some of the code

24 Apr 2012 1.8

Included acknowledgements

13 Sep 2012 1.10

Final update including full GUI and more. See description for details.

Contact us