| 1 |
# A tiny analysis script to demonstrate duecredit |
| 2 |
# |
| 3 |
# Import of duecredit is not necessary if you just run this script with |
| 4 |
# python -m duecredit |
| 5 |
# import duecredit # Just to enable duecredit |
| 6 |
from scipy.cluster.hierarchy import linkage |
| 7 |
from scipy.spatial.distance import pdist |
| 8 |
from sklearn.datasets import make_blobs |
| 9 |
|
| 10 |
print("I: Simulating 4 blobs") |
| 11 |
data, true_label = make_blobs(centers=4) |
| 12 |
|
| 13 |
dist = pdist(data, metric="euclidean") |
| 14 |
|
| 15 |
Z = linkage(dist, method="single") |
| 16 |
print("I: Done clustering 4 blobs") |