This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.spatial import Voronoi | |
from shapely.geometry import Polygon | |
def voronoi_finite_polygons_2d(vor, radius=None): | |
""" | |
Reconstruct infinite voronoi regions in a 2D diagram to finite | |
regions. |