navis.nbl.make_clusters¶
- navis.nbl.make_clusters(x, t, criterion='n_clusters', method='ward', **kwargs)[source]¶
Form flat clusters.
This is a thin wrapper around
scipy.cluster.hierarchy.cut_tree
andscipy.cluster.hierarchy.fcluster
functions.- Parameters:
x (DataFrame | array) – Pandas DataFrame is assumed to be NBLAST scores. Array is assumed to be a linkage.
t (scalar) – See
method
.criterion (str) –
- Method to use for creating clusters:
n_clusters uses
cut_tree
to createt
clusters- height uses
cut_tree
to cut the dendrogram at height
t
- height uses
inconsistent, distance, maxclust, etc are passed through to
fcluster
method (str) – Method for
linkage
. Ignored ifx
is already a linkage.**kwargs – Additional keyword arguments are passed through to the cluster functions
cut_tree
andfcluster
.
- Returns:
clusters
- Return type:
np.ndarray