Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

src/n/i/nipy-0.3.0/examples/algorithms/clustering_comparisons.py   nipy(Download)
seeds = np.argsort(nr.rand(F.V))[:nbseeds]
seeds, label, J0 = F.geodesic_kmeans(seeds)
wlabel, J1 = F.ward(nbseeds)
seeds, label, J2 = F.geodesic_kmeans(seeds, label=wlabel.copy(), eps=1.e-7)
 

src/n/i/nipy-0.3.0/examples/labs/need_data/demo_ward_clustering.py   nipy(Download)
image_field.from_3d_grid(ijk, k=6)
image_field.set_field(data)
u, _ = image_field.ward(100)
 
# write the results