Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

nilearn.regions.recursive_neighbor_agglomeration

nilearn.regions.recursive_neighbor_agglomeration(X, mask_img, n_clusters, n_iter=10, threshold=1e-07, verbose=0)[source]

Recursive neighbor agglomeration (ReNA).

It performs iteratively the nearest neighbor grouping. See Hoyos-Idrobo et al.[1].

Parameters:
Xnumpy.ndarray

Training data. shape = [n_samples, n_features]

mask_imgNiimg-like object

Object used for masking the data.

n_clustersint

The number of clusters to find.

n_iterint, default=10

Number of iterations.

thresholdfloat in the close interval [0, 1], default=1e-7

The threshold is set to handle eccentricities.

verboseint, default=0

Verbosity level.

Returns:
n_componentsint

Number of clusters.

labelsnumpy.ndarray

Cluster assignation. shape = [n_features]

References