Isolation distance (isolation_distance
)¶
Calculation¶
\(C\) : cluster of interest.
\(N_s\) : number of spikes within cluster \(C\).
\(N_n\) : number of spikes outwith cluster \(C\).
\(N_{min}\) : minimum of \(N_s\) and \(N_n\).
\(\mu_C\), \(\Sigma_C\) : mean vector and covariance matrix for spikes within \(C\) (where Each spike within \(C\) is represented by a vector of principal components (PCs)).
\(D_{i,C}^2\) : for every spike \(i\) (represented by vector \(x_i\)) outwith cluster \(C\), the Mahalanobis distance (as below) between \(\mu_c\) and \(x_i\) is calculated. These distances are ordered from smallest to largest. The \(N_{min}\)’th entry in this list is the isolation distance.
Geometrically, the isolation distance for unit \(C\) is the radius of the circle which contains \(N_{min}\) spikes from unit \(C\) and \(N_{min}\) spikes from outwith unit \(C\).
Expectation and use¶
Isolation distance can be interpreted as a measure of distance from the unit to the nearest cluster. A well isolated unit should have a large isolation distance.
References¶
Cluster quality metrics computed from principal components.
- spikeinterface.qualitymetrics.pca_metrics.mahalanobis_metrics(all_pcs, all_labels, this_unit_id)¶
Calculates isolation distance and L-ratio (metrics computed from Mahalanobis distance)
- Parameters
- all_pcs2d array
The PCs for all spikes, organized as [num_spikes, PCs].
- all_labels1d array
The cluster labels for all spikes. Must have length of number of spikes.
- this_unit_idint
The ID for the unit to calculate these metrics for.
- Returns
- isolation_distancefloat
Isolation distance of this unit.
- l_ratiofloat
L-ratio for this unit.
Literature¶
Introduced by [Harris].
Citations¶
- Harris
Kenneth D Harris, Hajime Hirase, Xavier Leinekugel, Darrell A Henze, and Gy ̈orgy Buzs ́aki. Temporal interaction between single spikes and complex spike bursts in hippocampal pyramidal cells. Neuron (Cambridge, Mass.), 32(1):141–149, 2001.