Benchmarking

DiRe-JAX includes comprehensive benchmarking utilities to compare its performance against other dimensionality reduction methods.

Quality Assessment

The benchmarking utilities provide comprehensive quality assessment for dimensionality reduction results, including structure preservation analysis and comparative evaluations.

Benchmarking Functions

The dire_utils module provides functions for benchmarking:

from dire_jax.dire_utils import run_benchmark, viz_benchmark
from jax import random

# Run a single benchmark or a larger sample
results = run_benchmark(reducer,
                        features,
                        labels=labels,
                        dimension=1, # for persistence homology
                        subsample_threshold=0.1, # subsample for speed
                        rng_key=random.PRNGKey(42),
                        num_trials=1, # choose sample size
                        only_stats=True,)

# and print the results ...
print(results)

# You can also visualize the benchmark and check how the persistence homology
# changes between the original data and the embedding
viz_benchmark(reducer,
              features,
              labels=labels,
              dimension=1, # for persistence homology
              subsample_threshold=0.1, # subsample for speed
              rng_key=random.PRNGKey(42),
              point_size=2)

Jupyter Notebook

For detailed benchmarking examples and comprehensive performance analysis, see the Jupyter notebook in the repository:

Open in Colab