← Back to projects

Algorithms · Open source

mdapy-v2

A maintained and optimised Python implementation of the Maximum Dissimilarity Algorithm for selecting representative subsets.

Python · NumPy · Numba · uv · PyPI · Testing

Visual identity for the mdapy-v2 project

The problem

Select diverse samples from large datasets while correctly handling directional variables and addressing performance, validation, and API limitations in the original implementation.

My contribution

Author of the original implementation at IHCantabria and current maintainer of its evolution as a personal project, with a revised API, correctness checks, examples, and performance improvements.

Outcome

An actively maintained package published on PyPI. In the documented benchmark with 140,256 observations and 20 selections, median runtime decreased from 32.63 to 0.067 seconds.

Technical decisions

  • DataColumn-based API with explicit validation and a separate compatibility layer for the legacy interface.
  • An optimised NumPy engine by default, with optional Numba acceleration.
  • Reproducible benchmarks that verify selected indices before measuring performance.

Links