Skip to content

Re-implementation of the paper titled "On Spectral Clustering: Analysis and an algorithm" by AY Ng et al.

Notifications You must be signed in to change notification settings

mark-antal-csizmadia/spectral-clustering

Repository files navigation

spectral-clustering

Introduction

Re-implementation of the paper titled On Spectral Clustering: Analysis and an algorithm by AY Ng et al. from NIPS 2001.

Data

  • example1.dat: This data set was prepared by Ron Burt. He dug out the 1966 data collected by Coleman, Katz and Menzel on medical innovation. They had collected data from physicians in four towns in Illinois, Peoria, Bloomington, Quincy and Galesburg.
  • example2.dat: A synthetic graph.

The graphs are defined by edges in the data files, and both are undirected.

Method

As discussed in the paper.

alt text

How to Run

Install the dependencies from the virtual environment defined in environment.yml. Then, for instance, run on example1.dat:

python main.py --dataset_name example1 --seed 123

or on example2.dat:

python main.py --dataset_name example2 --seed 123

Results

Example1 (4 clusters)

Affinity (adjacency) matrix of graph g: alt text

Fiedler vector (2nd eigenvector) of adjacency matrix: alt text

Eigenvalues in ascending order of adjacency matrix: alt text

Eigenvalues in ascending order of adjacency matrix (zoomed in): alt text

The 4 clusters in graph g found via spectral clustering: alt text

Example2 (2 clusters)

Affinity (adjacency) matrix of graph g: alt text

Fiedler vector (2nd eigenvector) of adjacency matrix: alt text

Eigenvalues in ascending order of adjacency matrix: alt text

Eigenvalues in ascending order of adjacency matrix (zoomed in): alt text

The 2 clusters in graph g found via spectral clustering: alt text

About

Re-implementation of the paper titled "On Spectral Clustering: Analysis and an algorithm" by AY Ng et al.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages