Instantly share code, notes, and snippets.

View example.py
import numpy as np
import umap
# generate some points in 4D
points = np.random.random((2000, 4))
# project the points to 2D to get points proximate to one another
points = umap.UMAP().fit_transform(points)
from lloyd.lloyd import Field
View options.md

These are specified in ~/.matplotlib/matplotlibrc

'svg', 'nbAgg', 'Qt4Cairo', 'pgf', 'Qt5Agg', 'TkCairo', 'WXAgg', 'template', 'GTK3Agg', 'pdf', 'Qt4Agg', 'MacOSX', 'WX', 'agg', 'Qt5Cairo', 'cairo', 'ps', 'WXCairo', 'GTK3Cairo', 'TkAgg', 'WebAgg'

View .block
license: MIT
height: 500
scrolling: no
border: yes
View lsh-images.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View .block
license: MIT
height: 500
scrolling: no
border: yes
View .block
license: MIT
height: 800
scrolling: no
border: yes
View cluster.py
import numpy as np
import sklearn.cluster
from distance import levenshtein
words = list(c.keys()) # list of words to cluster
words = np.asarray(words)
X = -1*np.array([[levenshtein(w1,w2) for w1 in words] for w2 in words])
clf = sklearn.cluster.AffinityPropagation(affinity="precomputed", damping=0.5)
clf.fit(X)
View .block
license: gpl-3.0
View .block
license: mit
View british-isles.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.