Re-implementation of the paper titled On Spectral Clustering: Analysis and an algorithm by AY Ng et al. from NIPS 2001.
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.
As discussed in the paper.
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
Affinity (adjacency) matrix of graph g:
Fiedler vector (2nd eigenvector) of adjacency matrix:
Eigenvalues in ascending order of adjacency matrix:
Eigenvalues in ascending order of adjacency matrix (zoomed in):
The 4 clusters in graph g found via spectral clustering:
Affinity (adjacency) matrix of graph g:
Fiedler vector (2nd eigenvector) of adjacency matrix:
Eigenvalues in ascending order of adjacency matrix:
Eigenvalues in ascending order of adjacency matrix (zoomed in):