DPPy
DPPy samples from determinantal point processes. Given a kernel that says how similar any two items are, a k-DPP places more probability on subsets whose members are mutually dissimilar — so drawing from it tends to produce a spread-out selection.
It is included here because that makes it a genuine alternative for "give me a diverse subset", and excluded from any ranking because it is not solving the same problem. Every other tool in this comparison returns an answer it claims is good by some measure. DPPy returns a draw. Ask twice and you get two different subsets, neither of which is put forward as better.
That distinction is why its objective row is empty rather than partially filled. The temptation is to read the empty row as a weakness; it is more accurately a different contract. Where you want a diverse sample — for downstream ensembling, or to explore rather than commit — being able to draw repeatedly is the feature, and a maximizer is the wrong tool.
Problem targeted
Given \(n\) items and a positive semi-definite similarity kernel \(L \in \mathbb{R}^{n \times n}\), a k-DPP defines a probability distribution over subsets of fixed size \(k\):
where \(L_S\) is the submatrix of \(L\) indexed by \(S\). The determinant is large when the selected items are close to mutually orthogonal in the kernel's feature space, which is the sense in which the distribution favors diversity. DPPy draws from this distribution; it does not search for the \(S\) that maximizes \(\det(L_S)\) — that problem is NP-hard.
Guarantee: sampler, not optimizer. The guarantee is distributional. Exact k-DPP sampling draws from precisely the distribution above, with no claim whatsoever about any individual draw's diversity relative to the best possible subset.
Reference
At a glance
| Guarantee | sampler, not optimizer | |
| License | MIT | |
| Version | 0.3.3 | |
| Released | 2024-08-14 | |
| Determinism | seeded sampling | |
| Input | a similarity kernel matrix | |
| Source | https://dppy.readthedocs.io/ | |
| Last verified | 2026-07-27 |
Capabilities
Support: ✔ built in · ◐ reachable, but you supply the model, transform or metric · — not available
| Capability | Support | Notes |
|---|---|---|
| distance metrics · L1 (Manhattan) distance | ◐ | 1 |
| distance metrics · L2 (Euclidean) distance | ◐ | 1 |
| distance metrics · cosine distance | ◐ | 1 |
| distance metrics · caller-supplied distances | ✔ | 2 |
| diversity objectives · maximize the minimum separation | — | 3 |
| diversity objectives · maximize the mean nearest-neighbor separation | — | 3 |
| diversity objectives · maximize the geometric-mean nearest-neighbor separation | — | 3 |
| diversity objectives · maximize the mean pairwise distance | — | 3 |
| constraints beyond k · per-group counts over disjoint groups | — | |
| constraints beyond k · per-group counts over overlapping groups | — | |
| constraints beyond k · minimum and maximum counts per group | — | |
| time budget · budget expressed as an iteration count | ◐ | 4 |
| time budget · budget expressed as wall-clock time | — | |
| time budget · the answer improves when given more budget | — | |
| largest practical problem size | n ≈ 104 | 5 |
-
Reachable only through the kernel you supply. DPPy never sees vectors or a distance function: you choose how similarity is defined when you build the kernel, and any metric you can express that way is available. ↩↩↩
-
The kernel is entirely caller-supplied, so a custom similarity is the native case rather than a workaround. Note the sign convention differs from a distance: the kernel encodes similarity, and diversity comes from its determinant being large. ↩
-
DPPy draws samples from a determinantal point process rather than maximizing anything. Diversity is a property of the distribution it samples from — subsets whose kernel submatrix has a large determinant are more likely — so no objective is optimized and no selection is claimed to be best. ↩↩↩↩
-
You can ask for more samples, but a sample count is a number of independent draws, not an improvement budget — the tenth draw is no better than the first, merely different. ↩
-
An n × n kernel matrix must be materialized, and exact k-DPP sampling eigendecomposes it — an O(n³) step that dominates well before memory does. Around n ≈ 10⁴ that is still minutes; beyond it, approximate samplers are the only route. ↩