graphclust.metrics#

Quality of low-dimensional maps.

Distance preservation

sammon_stress(), mds_stress(), residual_variance().

Neighborhood preservation

trustworthiness_continuity() (Venna and Kaski 2001), coranking_matrix() and the rank-based curves qnx_curve(), rnx_curve(), lcmc_curve() with the scalar summary auc_rnx() (Lee and Verleysen 2009; Lee, Peluffo-Ordóñez and Verleysen 2015).

Map topology

topographic_error(), topographic_product().

All functions accept data matrices or, with precomputed=True, distance matrices, so that graph (geodesic) distances can serve as the reference in the input space.

Stress, trustworthiness, continuity and the co-ranking framework.

Functions#

auc_rnx([X_high, Y, precomputed, Q])

Area under the \(R_{NX}(K)\) curve with logarithmic K axis, \(\sum_K R_{NX}(K)/K\,/\sum_K 1/K\).

coranking_matrix(X_high, Y, *[, precomputed])

Co-ranking matrix \(\mathbf{Q}\) (Lee and Verleysen 2009).

lcmc_curve([X_high, Y, precomputed, Q])

Local continuity meta-criterion \(\mathrm{LCMC}(K)=Q_{NX}(K)-K/(N-1)\) (Chen and Buja 2009).

mapping_quality(X_high, Y, *[, k, precomputed])

All distance- and neighborhood-preservation measures of a map in one dictionary.

mds_stress(X_high, Y, *[, precomputed])

Normalized metric MDS stress \(\sum_{i<j}(d^*_{ij}-d_{ij})^2/\sum_{i<j}d^{*2}_{ij}\).

qnx_curve([X_high, Y, precomputed, Q])

\(Q_{NX}(K)=\frac{1}{KN}\sum_{h,l\le K}Q_{hl}\), the average overlap of the K-ary neighborhoods, \(K=1..N-2\).

residual_variance(X_high, Y, *[, precomputed])

Residual variance \(1-R^2(\mathbf{D}^*_X,\mathbf{D}_Y)\) (Tenenbaum et al. 2000).

rnx_curve([X_high, Y, precomputed, Q])

\(R_{NX}(K)=\frac{(N-1)Q_{NX}(K)-K}{N-1-K}\): neighborhood preservation rescaled so that a random map scores 0.

sammon_stress(X_high, Y, *[, precomputed])

Sammon stress \(E_S=\frac{1}{\sum_{i<j}d^*_{ij}}\sum_{i<j}\frac{(d^*_{ij}-d_{ij})^2}{d^*_{ij}}\).

topographic_error(X, nodes, map_adjacency)

Share of samples whose two nearest nodes are not adjacent in the map graph (Kiviluoto 1996).

topographic_product(nodes, positions)

Topographic product of Bauer and Pawelzik (1992) between node vectors and their map positions.

trustworthiness_continuity(X_high, Y[, k, ...])

Trustworthiness \(M_1(k)\) and continuity \(M_2(k)\) (Venna and Kaski 2001).