Desnity Preservation¶
Description¶
The Density Preservation metric evaluates how well a dimensionality reduction method maintains the local density of points between the original high-dimensional space and the reduced low-dimensional space. This is crucial for avoiding misleading visual artifacts where dense regions in the original data appear artificially sparse or overly compact after projection. It is especially relevant in single-cell RNA-seq data, where local cell density often reflects biologically meaningful states.
Formulas¶
Local Density Estimation¶
For each point \(i\), the local density \(\rho_i\) is estimated as the inverse of the average distance to its \(k\)-nearest neighbors:
where \(d(i,j)\) is the distance between points \(i\) and \(j\), and \(\text{KNN}(i)\) is the set of the \(k\)-nearest neighbors of \(i\).
Spearman Correlation¶
The final metric is the Spearman correlation between the local density vectors in the high-dimensional and low-dimensional spaces:
Value Range¶
The metric ranges from -1 (complete inversion of density) to 1 (perfect preservation). A value near 0 indicates no correlation between densities.