Skip to content

Instantly share code, notes, and snippets.

View tpudlik's full-sized avatar

Ted Pudlik tpudlik

View GitHub Profile
@tpudlik
tpudlik / spectral_clustering.py
Last active February 18, 2016 16:00
Reproduces the spectral clustering example of Figure 14.29 in Hastie, Tibshirani and Friedman (2nd ed).
# Reproduce the spectral clustering example of Figure 14.29.
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import SpectralClustering
def sample(n):
assert n % 3 == 0