Leakage-free train/test splits for biological data, with certificates anyone can re-verify
Build, audit, and re-verify splits for proteins, nucleic acids, small molecules, cells, and patient cohorts. Built for ML researchers in computational biology and chemistry, benchmark maintainers, and coding agents.
Three-command quickstart
Clone, install in Python 3.10+, build a certified split on the bundled example, and re-verify every number from scratch:
git clone https://github.com/dnncha/splitproof.git && cd splitproof && pip install .
splitproof split examples/proteins.yaml
splitproof verify splitproof.cert.json --split split.csv
Audit the random split column in that same file with
splitproof audit examples/proteins.yaml --split-column fold_random.
On your own CSV, TSV, FASTA, or Parquet dataset, run splitproof init data.csv to draft a starter
policy.yaml, review the constraints, then run splitproof split policy.yaml.
Measured on public benchmarks
Audited on 24 November 2026 across six MoleculeNet datasets and every reviewed human protein in UniProt
(full report,
reproducible via scripts/realdata.py).
Random 80/20 splits on six MoleculeNet sets (BACE, BBBP, ClinTox, ESOL, Lipophilicity, HIV) leak Tanimoto ≥ 0.8 pairs across train and test; five of six leak exact duplicate compounds.
BACE's official Model split puts the same compound in both train (neutral) and test (protonated at the guanidine). Raw SMILES comparison misses it; charge neutralisation catches it.
Across all 20,429 reviewed human proteins in UniProt, MMseqs2 identity (≥ 0.3, coverage 0.8) finds 137,696 related pairs compared with 4,126 for k-mer Jaccard (k=5, ≥ 0.3).
| Benchmark | Rows | Constraint audited | Related pairs | Crossing train/test |
|---|---|---|---|---|
| BACE (random 80/20) | 1,513 | Tanimoto ≥ 0.8 | 1,624 | 491 |
| BACE (random 80/20) | 1,513 | same ring systems | 11,565 | 3,774 |
BACE (official Model) | 1,513 | same compound (neutralised) | 1 | 1 |
| BBBP (random 80/20) | 2,050 | same compound / Tanimoto ≥ 0.8 | 78 / 251 | 25 / 64 |
| ClinTox (random 80/20) | 1,484 | same compound / Tanimoto ≥ 0.8 | 61 / 169 | 17 / 48 |
| ESOL (random 80/20) | 1,128 | same compound / Tanimoto ≥ 0.8 | 11 / 224 | 3 / 79 |
| Lipophilicity (random 80/20) | 4,200 | same compound / Tanimoto ≥ 0.8 | 0 / 1,217 | 0 / 411 |
| HIV (random 80/20) | 41,127 | same compound / Tanimoto ≥ 0.8 | 197 / 7,455 | 55 / 2,455 |
| UniProt human (random 80/20) | 20,429 | k-mer Jaccard ≥ 0.3 (k=5) | 4,126 | 1,316 |
| UniProt human (random 80/20) | 20,429 | MMseqs2 identity ≥ 0.3, cov 0.8 | 137,696 | 46,874 |
How it works
Declare your leakage rules in YAML or JSON: similarity constraints (sequence identity, k-mer Jaccard, Tanimoto, ring systems, canonical SMILES, exact duplicates), disjoint groups (donor, patient, plate, site), and one-directional temporal cutoffs.
splitproof builds single-linkage connected components across all declared similarity edges and shared
groups to form atomic independent units, then assigns those units to folds with a deterministic, row-order-invariant,
quantile-stratified allocator under seed. Every split writes splitproof.cert.json, and
splitproof verify recomputes every digest, unit statistic, constraint measurement, and diagnostic from
scratch.
splitproof invents no thresholds of its own, separates exhaustive
proof (satisfied) from heuristic or approximate evidence (satisfied_unproven), refuses
vacuous constraints (CONSTRAINT_VACUOUS) and impossible homology blobs (GIANT_UNIT),
and never calls k-mer Jaccard sequence identity.
Diagnostics emitted on every split and audit
- Nearest-neighbour similarity distribution: min, median, p90, p99, and max similarity from held-out rows to the reference fold.
- 1-NN similarity baseline: score from copying the closest training neighbour's label, with exact neighbour coverage. Report it beside every model metric.
- Independent unit structure: unit count and
largest_unit_fraction, showing your real effective sample size.
Built for coding agents and MCP
Every CLI command supports --json, deterministic exit codes (0 clean, 1
violated or --require-exact failure, 2 usage/data/verify error, 3
infeasible split), and structured error objects with a remedy field.
splitproof mcp exposes the same six operations over stdio with working-directory write confinement:
splitproof_init, splitproof_units, splitproof_split,
splitproof_audit, splitproof_verify, and splitproof_explain.
Claude Code
claude mcp add splitproof -- splitproof mcp
Cursor (.cursor/mcp.json)
{
"mcpServers": {
"splitproof": {
"command": "splitproof",
"args": ["mcp"]
}
}
}
Codex (~/.codex/config.toml)
[mcp_servers.splitproof]
command = "splitproof"
args = ["mcp"]
Agent discovery files
- agent/SKILL.md (operating rules)
- llms.txt (machine-readable index)
- server.json (MCP Registry manifest)
Backends and current limits
| Metric | Backend | Install | Exactness |
|---|---|---|---|
identity | MMseqs2 | mmseqs on PATH | heuristic |
kmer_jaccard | exact sparse Jaccard (n ≤ 20,000) | core install | exact |
kmer_jaccard | MinHash LSH (n > 20,000) | core install | lower_bound |
tanimoto | RDKit Morgan fingerprints (desalted, neutralised) | splitproof[chem] | exact |
ring_systems | canonical ring-system set over RDKit | splitproof[chem] | exact |
canonical_smiles | RDKit canonical SMILES (desalted, neutralised) | splitproof[chem] | exact |
exact_duplicate | normalised equality | core install | exact |
Reads CSV, TSV, FASTA, and Parquet (splitproof[parquet]). Only empty or whitespace-only cells are
missing; literal strings like NA, None, and Null stay valid group names.
Not implemented in 0.1.0
- 3D structural similarity (Foldseek or pocket similarity)
- 2D or bipartite splits for interaction datasets (drug-target, PPI, TCR-pMHC)
- In-memory pandas, Polars, or AnnData DataFrame API
- Opt-in bridge-entity dropping (
--max-drop) for breaking giant single-linkage components
Frequently asked questions
- What does a proven status in splitproof actually guarantee?
- A proven (
satisfied) status means an exhaustive backend compared every pair on the constraints declared in the policy, with zero absent or unparsable values on those keys, and zero violations crossed folds. It makes no claim about constraints you did not declare or whether your chosen threshold is strict enough for your field. - Why does splitproof separate k-mer Jaccard from sequence identity?
- k-mer Jaccard is a fast exact metric over k-mer sets, whereas sequence identity measures aligned homology. Across all 20,429 reviewed human proteins in UniProt, MMseqs2 sequence identity (≥ 0.3, coverage 0.8) found 137,696 related pairs compared with 4,126 for k-mer Jaccard (k=5, ≥ 0.3), a 33x gap. splitproof therefore never labels k-mer Jaccard as identity.
- What does splitproof verify check?
splitproof verifyrebuilds the entire certificate from scratch from the dataset and fold assignments and compares every section field by field: policy digest, dataset digest, assignment digest, unit structure, backend parameters, per-constraint measured counts, and nearest-neighbour diagnostics. Editing any number causes verification to fail and report the exact field path.- How does splitproof handle untrusted certificates?
- Backends accept only allowlisted numeric parameters from policies so a certificate cannot pick an executable path. During
verify, recorded dataset paths outside the working directory are refused unless--datais passed explicitly, and MCP output paths are confined to the current working directory. Certificates are integrity anchors rather than cryptographic signatures. - What is not implemented in splitproof 0.1.0?
- splitproof 0.1.0 does not yet implement 3D structural similarity (such as Foldseek or pocket metrics), 2D or bipartite splits for interaction datasets, an in-memory DataFrame API, or opt-in bridge-entity dropping to split giant single-linkage components.