Skip to content

Instantly share code, notes, and snippets.

View ralphpeterson's full-sized avatar

Ralph Emilio Peterson ralphpeterson

  • New York University
  • New York, New York
View GitHub Profile
@ahwillia
ahwillia / hclust_sort.py
Created June 22, 2020 23:26
Sort data points by hierarchical clustering
from sklearn.datasets import make_biclusters
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
def resort_rows_hclust(U):
"""Sorts the rows of a matrix by hierarchical clustering
Parameters:
U (ndarray) : matrix of data