241 Final Project

Spectral Clustering

In this project, we seek to group similar datapoints (of non-categorical data) into neighborhood clusters by applying a standard k-means clustering algorithm. To achieve this, we create a similarity matrix and find the first k eigenvectors for the Laplacian matrix, which measures the degree of connectedness of data clusters. Then, we apply k-means to the rows of the Laplacian matrix we generate by subtracting the adjacency matrix from the degree matrix which measures the degree of connections of each node in the graph.

Source:

Importing and Cleaning Data

We decided to scale our data down a little to make the numbers more manageable.

Here are 2 helper functions that plots the data. One will color the plot according to labels.

Calculating Similarity Matrix

Approach 1: Calculating the Fully Connected Graph with Gaussian Similarity Function

Approach 2: Calculating the k-nearest neighbor Similarity Matrix

Degree and Laplace Matrix

Putting it All together

Running the Lines Data Set