Skip to content

Structural Measures

Structural measures analyze the topology and geometry of the dataset.

N1 - Fraction of Borderline Points

Fraction of points on the class boundary using MST.

cm = ComplexityMeasures(X, y)
n1 = cm.calculate_N1()

Interpretation: - Higher values indicate more boundary complexity

N2 - Ratio of Intra/Extra Class Nearest Neighbor Distance

Compares distances within and between classes.

n2 = cm.calculate_N2()

Interpretation: - Lower values indicate better separation

T1 - Fraction of Hyperspheres Covering Data

Measures how many hyperspheres are needed to cover the data.

t1 = cm.calculate_T1()

Interpretation: - Higher values indicate more complex structure

DBC - Distance-Based Complexity

Measures complexity based on distance distributions.

dbc = cm.calculate_DBC()

LSC - Local Set Cardinality

Measures the average size of local neighborhoods.

lsc = cm.calculate_LSC()

Clust - Clustering Measure

Measures how well data forms clusters.

clust = cm.calculate_Clust()

Interpretation: - Higher values indicate more distinct clusters

NSG - Number of Spanning Graphs

Counts the number of connected components.

nsg = cm.calculate_NSG()

ICSV - Inter-Class to Intra-Class Similarity Variance

Compares inter-class and intra-class variance.

icsv = cm.calculate_ICSV()

ONB - Overlap of Neighborhoods Between Classes

Measures neighborhood overlap between classes.

onb = cm.calculate_ONB()

Example: Analyze All Structural Measures

cm = ComplexityMeasures(X, y)
structural = cm.get_all_complexity_measures(measures='structural')

for measure, value in structural.items():
    print(f"{measure}: {value:.4f}")

Next Steps