Hopkins statistic: Values near 1 support a clustered tendency,
values near 0.5 are consistent with complete spatial randomness, and values
near 0 indicate regular spacing. The statistic uses the formula from Cross
and Jain (1982), with exponent \(d = D\), where \(D\) is the number of
varying columns. Redundant constant columns therefore do not change the
statistic. A Beta(\(n\), \(n\)) comparison is an approximation under ideal
complete-spatial-randomness assumptions, not an unconditional finite-sample
distribution for every data set.
Note on interpretation: This function returns the Hopkins statistic H
where values close to 1 indicate clusterable data. Some other packages (e.g.,
performance::check_clusterstructure) return 1-H, where values close to
0 indicate clusterability. Always check the documentation of the specific
implementation you are using.
Breaking change: factoextra uses the corrected Hopkins statistic
formula (Wright 2022). Results differ from legacy factoextra and a one-time
warning is emitted. Set options(factoextra.warn_hopkins = FALSE) to
silence the warning.
For large datasets, nearest-neighbor distances are computed with a low-memory
fallback when the full pairwise matrix would exceed
getOption("factoextra.hopkins.max_matrix_cells", 2e7) cells.
Only the sampled row's own occurrence is excluded from its nearest-neighbor
search; a duplicated row therefore remains a valid zero-distance neighbor.
VAT (Visual Assessment of Cluster Tendency): The VAT displays
clustering tendency by showing square-shaped
dark (or colored) blocks along the diagonal in a VAT image.