private-lab-bench 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. private_lab_bench-0.1.0.dist-info/METADATA +268 -0
  2. private_lab_bench-0.1.0.dist-info/RECORD +120 -0
  3. private_lab_bench-0.1.0.dist-info/WHEEL +5 -0
  4. private_lab_bench-0.1.0.dist-info/entry_points.txt +3 -0
  5. private_lab_bench-0.1.0.dist-info/licenses/LICENSE +21 -0
  6. private_lab_bench-0.1.0.dist-info/top_level.txt +1 -0
  7. privatelabbench/__init__.py +1 -0
  8. privatelabbench/adapters/__init__.py +12 -0
  9. privatelabbench/adapters/base.py +41 -0
  10. privatelabbench/adapters/external_predictions.py +25 -0
  11. privatelabbench/adapters/fingerprints.py +55 -0
  12. privatelabbench/adapters/sklearn_adapter.py +97 -0
  13. privatelabbench/aggregate.py +623 -0
  14. privatelabbench/attestation.py +51 -0
  15. privatelabbench/audit.py +21 -0
  16. privatelabbench/benchmark_packs.py +174 -0
  17. privatelabbench/cli.py +1033 -0
  18. privatelabbench/compare.py +252 -0
  19. privatelabbench/config.py +123 -0
  20. privatelabbench/core/__init__.py +35 -0
  21. privatelabbench/core/interfaces.py +75 -0
  22. privatelabbench/core/local_io.py +57 -0
  23. privatelabbench/core/public_data.py +55 -0
  24. privatelabbench/core/registry.py +151 -0
  25. privatelabbench/data/benchmark_packs/README.md +7 -0
  26. privatelabbench/data/benchmark_packs/molecules-regression/README.md +13 -0
  27. privatelabbench/data/benchmark_packs/molecules-regression/config.yaml +55 -0
  28. privatelabbench/data/benchmark_packs/molecules-regression/expected_receipt.json +78 -0
  29. privatelabbench/data/benchmark_packs/molecules-regression/pack.yaml +15 -0
  30. privatelabbench/data/benchmark_packs/molecules-regression/predictions.csv +21 -0
  31. privatelabbench/data/benchmark_packs/proteins-binary/README.md +11 -0
  32. privatelabbench/data/benchmark_packs/proteins-binary/config.yaml +56 -0
  33. privatelabbench/data/benchmark_packs/proteins-binary/expected_receipt.json +82 -0
  34. privatelabbench/data/benchmark_packs/proteins-binary/pack.yaml +15 -0
  35. privatelabbench/data/benchmark_packs/proteins-binary/predictions.csv +13 -0
  36. privatelabbench/data/benchmark_packs/tabular-regression/README.md +11 -0
  37. privatelabbench/data/benchmark_packs/tabular-regression/config.yaml +51 -0
  38. privatelabbench/data/benchmark_packs/tabular-regression/expected_receipt.json +79 -0
  39. privatelabbench/data/benchmark_packs/tabular-regression/pack.yaml +15 -0
  40. privatelabbench/data/benchmark_packs/tabular-regression/predictions.csv +9 -0
  41. privatelabbench/data/integrations/matbench-reference.json +71 -0
  42. privatelabbench/data/integrations/proteingym-assays.json +74 -0
  43. privatelabbench/data/protocols/generic-binary-1.0.1.yaml +53 -0
  44. privatelabbench/data/protocols/generic-regression-1.0.0.yaml +58 -0
  45. privatelabbench/data/protocols/matbench-expt-is-metal-1.0.0.yaml +58 -0
  46. privatelabbench/data/protocols/matbench-jdft2d-1.0.0.yaml +57 -0
  47. privatelabbench/data/protocols/matbench-steels-1.0.0.yaml +57 -0
  48. privatelabbench/data/protocols/proteingym-dms-substitutions-spearman-1.0.0.yaml +60 -0
  49. privatelabbench/data/protocols/tdc-caco2_wang-1.0.0.yaml +57 -0
  50. privatelabbench/data/protocols/tdc-pgp_broccatelli-1.0.0.yaml +59 -0
  51. privatelabbench/data/schemas/benchmark-leaderboard-v1.schema.json +20 -0
  52. privatelabbench/data/schemas/benchmark-submission-v1.schema.json +15 -0
  53. privatelabbench/data/schemas/cross-site-aggregate-v1.schema.json +39 -0
  54. privatelabbench/data/schemas/degradation-summary-v1.schema.json +458 -0
  55. privatelabbench/data/schemas/evaluation-design-audit-summary-v1.schema.json +189 -0
  56. privatelabbench/data/schemas/evaluation-design-audit-v1.schema.json +33 -0
  57. privatelabbench/data/schemas/evaluation-design-v1.schema.json +378 -0
  58. privatelabbench/data/schemas/evaluation-protocol-v1.schema.json +277 -0
  59. privatelabbench/data/schemas/evaluation-receipt-v1.schema.json +113 -0
  60. privatelabbench/data/schemas/external-validation-profile-v1.schema.json +39 -0
  61. privatelabbench/data/schemas/external-validation-v1.schema.json +19 -0
  62. privatelabbench/data/schemas/hidden-benchmark-v1.schema.json +19 -0
  63. privatelabbench/data/schemas/longitudinal-series-v1.schema.json +42 -0
  64. privatelabbench/data/schemas/matbench-evaluation-v1.schema.json +23 -0
  65. privatelabbench/data/schemas/model-manifest-v1.schema.json +41 -0
  66. privatelabbench/data/schemas/multiplicity-policy-v1.schema.json +15 -0
  67. privatelabbench/data/schemas/paired-comparison-artifact-v1.schema.json +108 -0
  68. privatelabbench/data/schemas/proteingym-evaluation-v1.schema.json +26 -0
  69. privatelabbench/data/schemas/quality-policy-v1.schema.json +306 -0
  70. privatelabbench/data/schemas/release-policy-v1.schema.json +54 -0
  71. privatelabbench/data/schemas/sampling-design-v1.schema.json +25 -0
  72. privatelabbench/data/schemas/submission-manifest-v1.schema.json +11 -0
  73. privatelabbench/design_audit.py +1139 -0
  74. privatelabbench/eval/__init__.py +0 -0
  75. privatelabbench/eval/degradation.py +918 -0
  76. privatelabbench/eval/metrics.py +204 -0
  77. privatelabbench/eval/paired_comparison.py +825 -0
  78. privatelabbench/eval/predictions.py +537 -0
  79. privatelabbench/eval/sampling.py +818 -0
  80. privatelabbench/eval/shift.py +13 -0
  81. privatelabbench/eval/slices.py +48 -0
  82. privatelabbench/eval/uncertainty.py +251 -0
  83. privatelabbench/evaluate.py +485 -0
  84. privatelabbench/external_validation.py +278 -0
  85. privatelabbench/federated/__init__.py +0 -0
  86. privatelabbench/federated/evaluator.py +107 -0
  87. privatelabbench/hidden_benchmarks.py +608 -0
  88. privatelabbench/identity.py +47 -0
  89. privatelabbench/integrations/__init__.py +1 -0
  90. privatelabbench/integrations/matbench.py +614 -0
  91. privatelabbench/integrations/proteingym.py +661 -0
  92. privatelabbench/integrations/tdc.py +369 -0
  93. privatelabbench/leaderboards.py +463 -0
  94. privatelabbench/models/__init__.py +0 -0
  95. privatelabbench/models/sklearn_baseline.py +9 -0
  96. privatelabbench/privacy/__init__.py +41 -0
  97. privatelabbench/privacy/aggregation.py +30 -0
  98. privatelabbench/privacy/attack_registry.py +62 -0
  99. privatelabbench/privacy/attacks.py +109 -0
  100. privatelabbench/privacy/dp.py +171 -0
  101. privatelabbench/privacy/export.py +524 -0
  102. privatelabbench/privacy/formal.py +225 -0
  103. privatelabbench/privacy/policy.py +92 -0
  104. privatelabbench/privacy/release.py +62 -0
  105. privatelabbench/protocols.py +278 -0
  106. privatelabbench/quality.py +219 -0
  107. privatelabbench/reports/__init__.py +0 -0
  108. privatelabbench/reports/integrity.py +96 -0
  109. privatelabbench/reports/json.py +78 -0
  110. privatelabbench/reports/manifest.py +190 -0
  111. privatelabbench/reports/markdown.py +257 -0
  112. privatelabbench/reports/paired_comparison.py +225 -0
  113. privatelabbench/reports/receipt.py +397 -0
  114. privatelabbench/reports/trust.py +175 -0
  115. privatelabbench/runner.py +748 -0
  116. privatelabbench/scoring.py +562 -0
  117. privatelabbench/tasks/__init__.py +0 -0
  118. privatelabbench/tasks/molecules.py +70 -0
  119. privatelabbench/trends.py +773 -0
  120. privatelabbench/validation.py +330 -0
@@ -0,0 +1,268 @@
1
+ Metadata-Version: 2.4
2
+ Name: private-lab-bench
3
+ Version: 0.1.0
4
+ Summary: Local-first evaluation for scientific machine learning on private data.
5
+ Author: Dipesh Tharu Mahato
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/dipeshbabu/private-lab-bench
8
+ Project-URL: Repository, https://github.com/dipeshbabu/private-lab-bench
9
+ Project-URL: Issues, https://github.com/dipeshbabu/private-lab-bench/issues
10
+ Project-URL: Changelog, https://github.com/dipeshbabu/private-lab-bench/blob/main/CHANGELOG.md
11
+ Project-URL: Documentation, https://github.com/dipeshbabu/private-lab-bench/tree/main/docs
12
+ Keywords: scientific machine learning,evaluation,private data,reproducibility,privacy auditing,benchmarking
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numpy>=1.21
25
+ Requires-Dist: pandas>=1.3
26
+ Requires-Dist: scikit-learn>=1.0
27
+ Requires-Dist: PyYAML>=6.0
28
+ Provides-Extra: proteingym
29
+ Requires-Dist: biopython<2,>=1.81; extra == "proteingym"
30
+ Provides-Extra: matbench
31
+ Requires-Dist: matminer<0.11,>=0.9.3; extra == "matbench"
32
+ Provides-Extra: signing
33
+ Requires-Dist: cryptography>=41.0; extra == "signing"
34
+ Provides-Extra: rdkit
35
+ Requires-Dist: rdkit>=2023.9.1; extra == "rdkit"
36
+ Provides-Extra: tdc
37
+ Requires-Dist: PyTDC==0.4.1; extra == "tdc"
38
+ Requires-Dist: numpy<2,>=1.26.4; extra == "tdc"
39
+ Requires-Dist: pandas<3,>=2.1.4; extra == "tdc"
40
+ Requires-Dist: huggingface-hub<0.26,>=0.20.3; extra == "tdc"
41
+ Requires-Dist: setuptools<81,>=77; extra == "tdc"
42
+ Provides-Extra: dev
43
+ Requires-Dist: pytest>=7.0; extra == "dev"
44
+ Requires-Dist: jsonschema>=4.0; extra == "dev"
45
+ Requires-Dist: cryptography>=41.0; extra == "dev"
46
+ Provides-Extra: docs
47
+ Requires-Dist: mkdocs<2,>=1.6; extra == "docs"
48
+ Requires-Dist: mkdocs-material<10,>=9.7; extra == "docs"
49
+ Dynamic: license-file
50
+
51
+ <h1 align="center">PrivateLabBench</h1>
52
+
53
+ <p align="center">
54
+ Evaluate scientific models on private data, from your terminal.
55
+ </p>
56
+
57
+ <p align="center">
58
+ <a href="https://github.com/dipeshbabu/private-lab-bench/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/dipeshbabu/private-lab-bench/ci.yml?branch=main&label=build&style=flat-square"></a>
59
+ <a href="https://pypi.org/project/private-lab-bench/"><img alt="PyPI" src="https://img.shields.io/pypi/v/private-lab-bench?style=flat-square"></a>
60
+ <a href="https://github.com/dipeshbabu/private-lab-bench/blob/main/pyproject.toml"><img alt="Python 3.10, 3.11, and 3.12" src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue?style=flat-square"></a>
61
+ <a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-green?style=flat-square"></a>
62
+ </p>
63
+
64
+ <p align="center">
65
+ <a href="docs/quickstart.md">Quickstart</a> ·
66
+ <a href="docs/prediction_tables.md">Prediction tables</a> ·
67
+ <a href="docs/evaluation_receipts.md">Receipts</a> ·
68
+ <a href="CONTRIBUTING.md">Contributing</a>
69
+ </p>
70
+
71
+ ---
72
+
73
+ PrivateLabBench is a local evaluation framework for scientific machine learning. Bring a prediction table, measure performance across datasets and subgroups, estimate uncertainty, and compare models on matched samples. Keep the underlying data in your environment and exchange aggregate evaluation receipts with collaborators.
74
+
75
+ Evaluation runs locally without an account, hosted service, or data upload.
76
+
77
+ ## Installation
78
+
79
+ Use **Python 3.10 or later**. Create an environment for **v0.1.0**:
80
+
81
+ ```sh
82
+ python -m venv .venv
83
+ ```
84
+
85
+ Activate the environment and install:
86
+
87
+ ```sh
88
+ # macOS / Linux
89
+ source .venv/bin/activate
90
+
91
+ # Windows PowerShell
92
+ .venv\Scripts\Activate.ps1
93
+
94
+ python -m pip install private-lab-bench==0.1.0
95
+ plb --help
96
+ ```
97
+
98
+ The `privatelabbench` command is also available. Optional molecular featurization uses `python -m pip install 'private-lab-bench[rdkit]==0.1.0'`. See the [installation guide](docs/install.md) for source/development installs, or run the [quickstart notebook in Colab](https://colab.research.google.com/github/dipeshbabu/private-lab-bench/blob/v0.1.0/examples/notebooks/quickstart.ipynb).
99
+
100
+ ## Run Your First Evaluation
101
+
102
+ Start with a bundled synthetic benchmark pack:
103
+
104
+ ```sh
105
+ plb list-packs
106
+ plb run-pack community-tabular-regression@1.0.0
107
+ plb verify reports/benchmark_packs/tabular_regression_receipt.shareable.json
108
+ ```
109
+
110
+ Packs include example predictions and versioned evaluation settings. They work from installed wheels and require no model downloads or training. Other packs cover molecular regression and protein binary classification.
111
+
112
+ ## Evaluate Your Predictions
113
+
114
+ Use `prediction-table/v1` to evaluate outputs from your own model:
115
+
116
+ ```csv
117
+ sample_id,target,prediction,site,batch
118
+ s01,0.12,0.14,lab-a,b1
119
+ s02,0.20,0.23,lab-a,b1
120
+ s03,0.33,0.31,lab-b,b2
121
+ s04,0.41,0.45,lab-b,b2
122
+ ```
123
+
124
+ Save the table as `predictions.csv`, then run:
125
+
126
+ ```sh
127
+ plb evaluate predictions.csv --slice site --slice batch
128
+ plb verify reports/evaluation/evaluation_receipt.json
129
+ ```
130
+
131
+ Regression, binary classification, and multiclass probability tables are supported. Ambiguous columns or task types require explicit flags; binary probabilities with named labels require ordered negative/positive classes. Results stay local until a reviewed release policy permits export. This four-row example is too small for the default bootstrap interval or slice minimum. See the [5-minute quickstart](docs/quickstart.md) for defaults and the [prediction-table reference](docs/prediction_tables.md) for classification schemas.
132
+
133
+ ## Make Runs Reproducible
134
+
135
+ Store task, input, slice, uncertainty, and reporting settings in YAML:
136
+
137
+ ```sh
138
+ plb init predictions.csv --slice site --out evaluation.yaml
139
+ plb run evaluation.yaml
140
+ plb validate-config configs/tabular_uncertainty_eval.yaml
141
+ plb run configs/tabular_uncertainty_eval.yaml
142
+ ```
143
+
144
+ Config runs write local JSON and Markdown reports, an artifact manifest, and evaluation receipts. Review the uncertainty settings and choose a sampling method appropriate to your data. See [statistical uncertainty](docs/uncertainty.md) for assumptions and limits.
145
+
146
+ Use `plb list-protocols` and `plb run local.yaml --protocol plb://generic/regression@1.0.0` to apply fixed, versioned evaluation rules across private datasets. Receipts record the exact protocol digest. See [evaluation protocols](docs/protocols.md) for local definitions, package providers, and release controls.
147
+
148
+ ## Compare Models
149
+
150
+ Compare two prediction tables containing the same sample IDs and targets:
151
+
152
+ ```sh
153
+ plb compare model-a.csv model-b.csv --target target --task-type regression --metric rmse --resamples 1000 --practical-threshold 0.01
154
+ ```
155
+
156
+ Paired comparisons report metric differences, bootstrap intervals, and a decision relative to your practical threshold. Optional slice comparisons help locate differences across groups. See the [paired-comparison guide](docs/paired_comparison.md).
157
+
158
+ Combine compatible shared receipts with `plb aggregate lab-a.shareable.json lab-b.shareable.json --model model@revision`. The [aggregation guide](docs/aggregation.md) covers site identities, signer verification, and the metrics that support pooled point estimates.
159
+
160
+ Inspect cohort changes with `plb evaluate current.csv --reference reference.csv --slice site`. [Reference/current diagnostics](docs/degradation.md) report performance degradation, slice prevalence, and selected distribution changes, with explicit uncertainty and release controls.
161
+
162
+ Track the same model over repeated evaluations with [`plb trend`](docs/trends.md). It compares verified shareable receipts at declared collection times, retains uncertainty and quality decisions, and reports changing slices without needing prior raw datasets.
163
+
164
+ For repeated or nested observations, declare a [sampling design](docs/sampling_design.md) to resample independent clusters and keep paired models aligned. Optional slice-test families record dependence assumptions and multiplicity adjustments.
165
+
166
+ Check declared split integrity before scoring with `plb audit-design` or `plb evaluate --evaluation-design design.yaml`. [Evaluation-design audits](docs/evaluation_design.md) detect supported overlap/group/time violations and keep unavailable training evidence explicit.
167
+
168
+ Evaluate real Caco2 and PGP benchmark predictions with the optional [TDC ADMET integration](docs/tdc_admet.md). It preserves the pinned official test sets and metrics, checks upstream score agreement, and supports the same evaluation protocols on private ADMET tables.
169
+
170
+ The [Matbench integration](docs/matbench.md) supports composition and structure tasks with pinned official folds, units, corrected probability ROC-AUC, and verified upstream fold aggregation.
171
+
172
+ The [ProteinGym integration](docs/proteingym.md) evaluates DMS substitution scores within each assay, with tied-rank Spearman and explicit protein/function aggregation.
173
+
174
+ Describe evaluations of released models with the [external-validation profile](docs/external_validation.md): immutable model identity, declared evaluator relationship and dataset provenance, plus explicitly approved aggregate receipts that can be compared across labs.
175
+
176
+ When predictions need to be generated inside the lab, use the [trusted local scorer](docs/trusted_scoring.md) with a reviewed numeric model, pinned digest, and explicit feature units. Its optional evaluation pipeline reuses the normal protocol and release controls.
177
+
178
+ Operate a [hidden benchmark](docs/hidden_benchmarks.md) with owner-held labels, strict prediction submissions, approved result receipts, and a verified results table. Ranking requires an explicit rule in the pinned scientific protocol.
179
+
180
+ ## Inspect Evaluation Receipts
181
+
182
+ Follow the [Caco2 model-selection case](docs/case_study.md) from a fresh environment to a paired decision, critical-group diagnosis, release check, and signed receipt. It distinguishes real public benchmark evidence from its synthetic measurement-shift proxy; independent researcher trials remain pending.
183
+
184
+ `evaluation-receipt/v1` separates local context from aggregate information intended for exchange:
185
+
186
+ | Artifact | Contents |
187
+ | --- | --- |
188
+ | `<run>_receipt.json` | Local receipt, including paths, configuration, and exact results |
189
+ | `<run>_receipt.shareable.json` | Approved aggregate receipt, written only when the export policy allows it |
190
+ | `<run>_receipt.md` | Human-readable receipt summary |
191
+
192
+ ```sh
193
+ plb verify reports/tabular_uncertainty_demo_receipt.shareable.json
194
+ ```
195
+
196
+ Shareable receipts require an explicit `release-policy/v1` policy. A blocked export leaves local results and a release audit, and removes any previous shareable file. The bundled synthetic packs include reviewed example policies; private-data runs need their own review. Use `plb release-check <local-receipt.json> --policy release.yaml` for a dry run.
197
+
198
+ Verification checks artifact integrity and optional signatures. A matching self-contained hash alone does not establish authorship, correct execution, or scientific validity. See [evaluation receipts](docs/evaluation_receipts.md) and [report integrity](docs/report_integrity.md).
199
+
200
+ For offline signer authentication, use optional Ed25519 signatures and pinned public keys:
201
+
202
+ ```sh
203
+ plb verify receipt.shareable.json --trust-store trusted-labs.yaml --require-trusted-signer --json
204
+ ```
205
+
206
+ See the [receipt trust guide](docs/receipt_trust.md) for signing, key rotation, protocol binding, and the limits of these checks.
207
+
208
+ ## Privacy and Sharing
209
+
210
+ Keeping data local limits data movement; aggregate results can still disclose sensitive information. PrivateLabBench provides separate tools for exact reporting, empirical privacy audits, release-policy checks, and heuristic `metric_perturbation`.
211
+
212
+ Metric perturbation, including the deprecated `dp` alias, **does not provide a formal differential privacy guarantee**. Bounded-query DP reference primitives have their own sensitivity and accounting requirements. Read the [privacy guide](docs/privacy.md) before selecting a release method.
213
+
214
+ ## Reference
215
+
216
+ Enforce explicit model thresholds in CI with `plb gate <receipt> --policy quality.yaml`.
217
+ See [quality gates](docs/quality_gates.md) for confidence, baseline, slice, and privacy requirements.
218
+
219
+ Use `--help` to explore commands and options:
220
+
221
+ ```sh
222
+ plb eval-predictions --help
223
+ plb compare --help
224
+ plb list-tasks
225
+ plb list-privacy-attacks
226
+ ```
227
+
228
+ - [Five-minute quickstart](docs/quickstart.md)
229
+ - [Core concepts](docs/concepts.md)
230
+ - [Tasks and plugins](docs/tasks.md)
231
+ - [Community benchmark packs](docs/benchmark_packs.md)
232
+ - [Troubleshooting](docs/troubleshooting.md)
233
+ - [Project scope](docs/project_scope.md) and [roadmap](docs/roadmap.md)
234
+
235
+ ## Developing
236
+
237
+ Install the development and documentation tools:
238
+
239
+ ```sh
240
+ python -m pip install -e '.[dev,docs]' build twine
241
+ python -m pytest -q
242
+ python -m build
243
+ python -m twine check dist/*
244
+ mkdocs build
245
+ ```
246
+
247
+ CI tests Python 3.10, 3.11, and 3.12, validates packages and documentation, and exercises the Docker runner. It also installs the wheel in a clean environment and runs a bundled pack outside the checkout. Release publishing uses the [tag-based release workflow](docs/releases.md).
248
+
249
+ Useful source entry points:
250
+
251
+ | Path | Purpose |
252
+ | --- | --- |
253
+ | `privatelabbench/cli.py` | Command-line interface |
254
+ | `privatelabbench/core/` | Task registry and extension interfaces |
255
+ | `privatelabbench/eval/` | Metrics, slices, uncertainty, and paired comparisons |
256
+ | `privatelabbench/privacy/` | Privacy audits and release policies |
257
+ | `privatelabbench/reports/` | Reports, receipts, and artifact integrity |
258
+ | `privatelabbench/data/` | Bundled benchmark packs and schemas |
259
+
260
+ ## Contributing
261
+
262
+ Focused fixes, scientific-domain plugins, benchmark packs, and documentation improvements are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) for setup, extension boundaries, and validation requirements. Discuss new tasks, privacy methods, or schema changes in an issue before implementation.
263
+
264
+ The project follows its [Code of Conduct](CODE_OF_CONDUCT.md) and [governance guide](GOVERNANCE.md). Report sensitive vulnerabilities through the process in [SECURITY.md](SECURITY.md).
265
+
266
+ ## License
267
+
268
+ Released under the [MIT license](LICENSE). Use [CITATION.cff](CITATION.cff) to cite PrivateLabBench in research.
@@ -0,0 +1,120 @@
1
+ private_lab_bench-0.1.0.dist-info/licenses/LICENSE,sha256=uNhcAobnhiEEJeR8SXUpN05e9kcLb9ABoOnRygruUqg,1076
2
+ privatelabbench/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
3
+ privatelabbench/aggregate.py,sha256=Xx7gtXlMD2K04QiBcNDzyfUOt9WRUNwaLAaYM-mSq6c,26135
4
+ privatelabbench/attestation.py,sha256=X_u1fF852BfqQNlu-TONDCGHgclenC_RFF5CXV5GjRE,1736
5
+ privatelabbench/audit.py,sha256=7Q2Vfr1q6L3biI-UuH2tY3uS_Da8fnd_RrBIPIpNhXU,667
6
+ privatelabbench/benchmark_packs.py,sha256=a73S4YjVXRQ0M8QnEQWR2dWOSG4TJcnp0ktUIVEyhJs,6835
7
+ privatelabbench/cli.py,sha256=wH-EblJWC-lWSDngql0eMR5cFp5JoU6c6sLWlXrhfkg,66580
8
+ privatelabbench/compare.py,sha256=rrIGd7U9OI28xJRGQLGfmlkQ1jd-kbXBwomIpC65dU8,12833
9
+ privatelabbench/config.py,sha256=KQrbWzs4-dJfOeCUA0OlPKcuiQezVgm9Zp2VR1hrN9w,5784
10
+ privatelabbench/design_audit.py,sha256=MfQbiUtn8l4m3VS9MvqI2VtroEZGQbDPF9d_8R3AWV0,43696
11
+ privatelabbench/evaluate.py,sha256=ektvWE0q1np1Ro5Gnky2jUUK17SFzxDuGVC2-vplh_U,18687
12
+ privatelabbench/external_validation.py,sha256=HFk59WKxAhmRQ4hI58qfwspUTlt9Sg6u8-XxICHO2HM,10259
13
+ privatelabbench/hidden_benchmarks.py,sha256=0um_fyVLHTHB4QizdR5BIw7A6VnMyuwBH3qjwyedq-Y,22136
14
+ privatelabbench/identity.py,sha256=kdV6a8TP28CUymEnnR6v1QLmryaG9RExB6LvU2cFnuw,1661
15
+ privatelabbench/leaderboards.py,sha256=mTxC1qzA-4gl-QoNRWO5__HxqdkAr52y2hfdCR4GVXo,18481
16
+ privatelabbench/protocols.py,sha256=eCqcNY9stkVBjk0xTb_8cjlNTvytapHyatNJUVE-vbQ,17000
17
+ privatelabbench/quality.py,sha256=Cn5GBn9eSvWrqRkjP9q4wjzUM_kzK1jmwZtug9B8jo0,17077
18
+ privatelabbench/runner.py,sha256=Y9p0LBOs8tUYIlPA1BQTXRqbX67dlwl0x9HrZslQ9SY,37859
19
+ privatelabbench/scoring.py,sha256=sSQ10h2_ByP6YpZY1lw41yRWJL1sVdZJLwQkKVitbr4,22299
20
+ privatelabbench/trends.py,sha256=TpZ_KhB3XOoL82gLEiaeMyC-3tYgBdVrkV2sfSK7e4w,31339
21
+ privatelabbench/validation.py,sha256=IdE38G_tGdCl2NqhtYTTPvt-0LTCpcc20MvRBzG9inQ,13997
22
+ privatelabbench/adapters/__init__.py,sha256=cuoMjh8Eft-Y2hlOuNK40c5ElHxvZbS7pqtnjbb8slU,430
23
+ privatelabbench/adapters/base.py,sha256=36ZhO9omDGsNLHnQbW_qwQDmqK7h0WIgY0hYSGuiock,1167
24
+ privatelabbench/adapters/external_predictions.py,sha256=LXmOMA5tr25KS8iey_2_6VR65TXBtMXAbqm7CVTzVqI,733
25
+ privatelabbench/adapters/fingerprints.py,sha256=omZ1li2NNGQS2R3rzjhc0IkJopPseVbHtx4zVzdcF00,2050
26
+ privatelabbench/adapters/sklearn_adapter.py,sha256=cM3jcbVHUWW2w5cm1m2Te0jPjeqyi5PB68hNmi-TyfE,4251
27
+ privatelabbench/core/__init__.py,sha256=W-3NsS44JfG4z8H5lS_NPZLpGaDn-VG6f-v6lzEVuhk,641
28
+ privatelabbench/core/interfaces.py,sha256=Gc45_W8L3mRdj2pPxpqy46wbQWtimAx9z-OPZTLl6Cg,1860
29
+ privatelabbench/core/local_io.py,sha256=8frD0orosY8we8lTnCq1ngtRAZEQGyeMV_YGD8iAREs,1685
30
+ privatelabbench/core/public_data.py,sha256=9RKIwCRP41xWmcwtRRn1DB2BtL_t2PFAgVvAaItcZVQ,1963
31
+ privatelabbench/core/registry.py,sha256=DL4KEThOhhVFVKmDomaFwT54NComYuqvwI9gIm5smeM,4269
32
+ privatelabbench/data/benchmark_packs/README.md,sha256=ChbggNaz3Aza66NzDDgnRZQx1KjeTkrggToGua-DD_k,436
33
+ privatelabbench/data/benchmark_packs/molecules-regression/README.md,sha256=WxESBD-1-vcZ9uYT6ZXMJ6YQ8gUeRE_GhAqqnF0b9V0,415
34
+ privatelabbench/data/benchmark_packs/molecules-regression/config.yaml,sha256=VaGOXtELhfbrwBJ5vFJVTOm2UrMtGFTgKAjENhGd-5g,1195
35
+ privatelabbench/data/benchmark_packs/molecules-regression/expected_receipt.json,sha256=v1VC45Vuo8WRk1NAtb9iFy3ecJ-SqI9PGGtH2dWClws,1957
36
+ privatelabbench/data/benchmark_packs/molecules-regression/pack.yaml,sha256=dII8REZI10zYFjdju1Wb_el7PdpWkwWodDPNJZTWVg4,489
37
+ privatelabbench/data/benchmark_packs/molecules-regression/predictions.csv,sha256=iNBRQUQvmZ28hobaTPQyPoVFqLDgLfEXBEJxdIuF6xI,655
38
+ privatelabbench/data/benchmark_packs/proteins-binary/README.md,sha256=zZFmGKYOMc-W4_JvbRD9da40h8xeq850sBkX4cJoZII,592
39
+ privatelabbench/data/benchmark_packs/proteins-binary/config.yaml,sha256=rMOsK4dofW5u4TxJU7c3yf0OctjsUedbSQGZe75JwuE,1196
40
+ privatelabbench/data/benchmark_packs/proteins-binary/expected_receipt.json,sha256=AWyg0KdtAVT0nQkUx6yckBXYcKHqn0YI0UYJ2dHYJuA,1986
41
+ privatelabbench/data/benchmark_packs/proteins-binary/pack.yaml,sha256=9GO0mYojOjv2EAaCZX5J_TZfomdgrqFveHR_Vsb05fc,537
42
+ privatelabbench/data/benchmark_packs/proteins-binary/predictions.csv,sha256=Scb7jowNErP5t7x554X4OTCX9zyHZGBN56fU3ajsFKM,736
43
+ privatelabbench/data/benchmark_packs/tabular-regression/README.md,sha256=2L37604IcWXyyAjLJXg1AVIMy4z8cbXw5L0M9rfOfto,310
44
+ privatelabbench/data/benchmark_packs/tabular-regression/config.yaml,sha256=E4ub8L6nLLbehEV0GhrJx-IO7El-32CjdComr2huiIQ,1111
45
+ privatelabbench/data/benchmark_packs/tabular-regression/expected_receipt.json,sha256=c-kygts-BiXff8KkwHMybI7Ppcw5SnL2kWab-VstOUI,1970
46
+ privatelabbench/data/benchmark_packs/tabular-regression/pack.yaml,sha256=UM-DlX9LjB3rfFHxEu34sCuOQXftAY5kQ7xcfVJtAq4,446
47
+ privatelabbench/data/benchmark_packs/tabular-regression/predictions.csv,sha256=P9YsNoZj0w9zYCc8-1VV_fzejoLpMD9G4Yr2Ck4qZ80,191
48
+ privatelabbench/data/integrations/matbench-reference.json,sha256=vKVnTmCwZjwLkOobH6-Cs6Gswjhb1FhOMWmX3dQhUg4,3305
49
+ privatelabbench/data/integrations/proteingym-assays.json,sha256=SbyBnxa7Xo9FBW6vwcP0gEKi2GWmjTsowscAoH8T0PI,2662
50
+ privatelabbench/data/protocols/generic-binary-1.0.1.yaml,sha256=igf9dc8lGyZis7c143KT3P4WRzpkx79eEfhqzZfVQJs,1141
51
+ privatelabbench/data/protocols/generic-regression-1.0.0.yaml,sha256=LjQF9I8MX4jX53wtDHdExYZuBA77CRIFAeikpNULNp4,1134
52
+ privatelabbench/data/protocols/matbench-expt-is-metal-1.0.0.yaml,sha256=oWzJCvpZACrGA5v4VKWnljoujyg6in7KekjjxDZNGWM,1154
53
+ privatelabbench/data/protocols/matbench-jdft2d-1.0.0.yaml,sha256=ug-_8VOemsMjlPEN2_X2FKixK-Y0O-KHmlCFGEyao54,1139
54
+ privatelabbench/data/protocols/matbench-steels-1.0.0.yaml,sha256=Th6YzLKMyAG_6zbFZTqp5OfecqiBwZorbmoyyFFGb3A,1134
55
+ privatelabbench/data/protocols/proteingym-dms-substitutions-spearman-1.0.0.yaml,sha256=1Msmc7un-Ld9KWtOuB4uppLkkUaeuiJyAvAgPoGRQxU,1224
56
+ privatelabbench/data/protocols/tdc-caco2_wang-1.0.0.yaml,sha256=GpysovpzxBV0SOLcmWgF4Uusip_8AtfPsP9EqPMe1c8,1131
57
+ privatelabbench/data/protocols/tdc-pgp_broccatelli-1.0.0.yaml,sha256=0UQaoInggebgLvxE9lkHTw3j4gCEgPx7ke4bsMe1AUA,1164
58
+ privatelabbench/data/schemas/benchmark-leaderboard-v1.schema.json,sha256=0igmJCuh2HYkee6wmuEgVT29O_q_rTbpWZCYszsbS-I,2953
59
+ privatelabbench/data/schemas/benchmark-submission-v1.schema.json,sha256=5cNGqHZ5C7yVqcahRbOO6oVaJOma8HqjT78tSK6ttCw,1011
60
+ privatelabbench/data/schemas/cross-site-aggregate-v1.schema.json,sha256=7tWElvMGN-U9J8uHuzneOY4TGRmqfSPmGmpvrE1NznA,3411
61
+ privatelabbench/data/schemas/degradation-summary-v1.schema.json,sha256=34WBeoUHB41xFMcaMoteLQ16SDe1r2ulluIfkXGjKro,10680
62
+ privatelabbench/data/schemas/evaluation-design-audit-summary-v1.schema.json,sha256=tJYHKd_KB0g2vs4VcqHaqAIabaIFEYuEwZBGrJ0kpbo,4531
63
+ privatelabbench/data/schemas/evaluation-design-audit-v1.schema.json,sha256=DY5H_vJefVYCOy-_14FE4FMFvjfkhnxihb_k6RI_lzI,649
64
+ privatelabbench/data/schemas/evaluation-design-v1.schema.json,sha256=s3vqX8oyiHs84KW-OwhWFLG4D5tHFIbHKueTc-doHzg,8024
65
+ privatelabbench/data/schemas/evaluation-protocol-v1.schema.json,sha256=KC3uygldS8Kp3HURnijP13sN_EBVYHzOVHzPEYihbDo,6223
66
+ privatelabbench/data/schemas/evaluation-receipt-v1.schema.json,sha256=MqZuJezMqx2ARZ4NkuSAoJ9fwZ06g2q5yNT9l5_jt6E,4242
67
+ privatelabbench/data/schemas/external-validation-profile-v1.schema.json,sha256=AswYMQ3gvPCY5PLVe9ZESTybCRvf_-yF1qGFDBDY80k,1950
68
+ privatelabbench/data/schemas/external-validation-v1.schema.json,sha256=rnNmWLcdiR8carGRKLr6Rrb4NBdaBlpAe3lVaNYCK5Q,1107
69
+ privatelabbench/data/schemas/hidden-benchmark-v1.schema.json,sha256=EYqFDVPGE0QhGWAm5cQJzGEweDilgZs7b3wRNKqDZSI,1825
70
+ privatelabbench/data/schemas/longitudinal-series-v1.schema.json,sha256=9Db8rGvpRlgCVbWQbFN0ofKjJUrbKFhcjJ6edyy1f4s,4857
71
+ privatelabbench/data/schemas/matbench-evaluation-v1.schema.json,sha256=OxGqk7yLFI46qsigPZx0GKjZIZyBHZDdlMwIpz-sPSM,3292
72
+ privatelabbench/data/schemas/model-manifest-v1.schema.json,sha256=VwdLnUH6MjGMTaUa80Hu1yT6MM0OFgbhmJE6wxiU0Ao,2509
73
+ privatelabbench/data/schemas/multiplicity-policy-v1.schema.json,sha256=WMV0vhYWK-UZEFtUg-OrEPqjd6fNLMveMY2j4zq3KdE,891
74
+ privatelabbench/data/schemas/paired-comparison-artifact-v1.schema.json,sha256=CdxaN2m-xdEEX1faEI_14p6sydf4ogWou41SZARaVss,3712
75
+ privatelabbench/data/schemas/proteingym-evaluation-v1.schema.json,sha256=SKINTR4EaEI8uD6d5LMkFCYtdyjoB5VYalojbKyqehg,4284
76
+ privatelabbench/data/schemas/quality-policy-v1.schema.json,sha256=3FBpCd_R88bTN8K7T6c09woaYov7-xqMRySOcu6cUq8,6064
77
+ privatelabbench/data/schemas/release-policy-v1.schema.json,sha256=h5C6Hcth9Vgn-bKysxz3yTk40Ys7ChiOTwBrUpkdAEI,3977
78
+ privatelabbench/data/schemas/sampling-design-v1.schema.json,sha256=6gYMM6YOUexwE478th3P6Z1eWKrQuFWzu8jJOtHiwgA,1760
79
+ privatelabbench/data/schemas/submission-manifest-v1.schema.json,sha256=otVCCMqAQOKXfgi6b1wI7aExztDABt0y2IhhA1mFU3c,728
80
+ privatelabbench/eval/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
+ privatelabbench/eval/degradation.py,sha256=OFkxrcU2K6r0ZzYAH-2L7W9kB6nGuyGCDDH9aJ2G1rM,34662
82
+ privatelabbench/eval/metrics.py,sha256=y4zp4onBBvmE_vKxcxOd8uNndP0bYE5WnQYto4XBp3Q,6647
83
+ privatelabbench/eval/paired_comparison.py,sha256=YDpf38txGlAQuwtdrfYpBoPOPN9LK37hFsCu4wdMVDQ,32128
84
+ privatelabbench/eval/predictions.py,sha256=f6Pu4wNZ91VKdrzY4dR7oG1dVLBRNQF8mA8VAnoYZfk,22522
85
+ privatelabbench/eval/sampling.py,sha256=Bc-SYYOJBOjgQvOS3tCOkZYFwWQ0GwPT5ujTkHLLYqE,30069
86
+ privatelabbench/eval/shift.py,sha256=XsYW8FAz_WYqIgIcSVc6FYNkBkKQW6PbjNIKRZy-cMM,424
87
+ privatelabbench/eval/slices.py,sha256=8uPxOhqvY7QyYoNv31DNEcYx60AcHNxNbvySD8QUG7I,2253
88
+ privatelabbench/eval/uncertainty.py,sha256=9OX1V57n3xVW9fR3-dENnhOldoaYfDVYwj4ivaj0fiA,9144
89
+ privatelabbench/federated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
90
+ privatelabbench/federated/evaluator.py,sha256=4uUrNJzVY0j_7F0h9uYkSrQ9GOWlgb5VB39E6WxCuXU,3658
91
+ privatelabbench/integrations/__init__.py,sha256=Yp2GMoW8J_U0fgF0lWok8zABRukJMg3mNjtYLCpK9z0,77
92
+ privatelabbench/integrations/matbench.py,sha256=DNGiZUVGkdYF8pJdocSDyr6Z1rBiC8s1Pd8C2FOfWbQ,22057
93
+ privatelabbench/integrations/proteingym.py,sha256=99iq30NAY-ZSHew3BKv1gR01dX6swk8B2vLwS9ZX8EM,24295
94
+ privatelabbench/integrations/tdc.py,sha256=5WK3Hj8q4YDAm0QhJZu-N29lcqa05XsjZ8mBvXmSm0g,13721
95
+ privatelabbench/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
+ privatelabbench/models/sklearn_baseline.py,sha256=PUAfw7wQpNtRDJ16jc1ruTMG9Y5usrxGf3iVrOzup8o,474
97
+ privatelabbench/privacy/__init__.py,sha256=xqobpBPAAaWJv8uSC7CXOSytdjDHftqMwdppW5kIuaE,1043
98
+ privatelabbench/privacy/aggregation.py,sha256=IdPpTcyBlRlnNFyofudbqdrJkbPlqZE8BXfMcWqIHmA,1122
99
+ privatelabbench/privacy/attack_registry.py,sha256=301VfAt9H29jyHRd3pbI3r8cogfuSQ0DimNrtZUBwjs,1587
100
+ privatelabbench/privacy/attacks.py,sha256=9Wcy33KN6ZlSZV-vmeMmKi2F2WFr7NB4duktnuCnt1s,3943
101
+ privatelabbench/privacy/dp.py,sha256=XEgzRm3eC8AdQXo2Kb8eih926OKWgLhPh4CLxO1LC78,6062
102
+ privatelabbench/privacy/export.py,sha256=ZJyu3vaTN4NoFchGBe7VR4yoI4wqDRHfStCGaTZkYeM,34244
103
+ privatelabbench/privacy/formal.py,sha256=3q6lqbHp31HM_fqoWuWnMU3QqNZ4LYSTnqZTfPcETCA,7904
104
+ privatelabbench/privacy/policy.py,sha256=pm1n1akRyIsvbNzkwb-O2fXeq1oynmIz_1QpDr9iv_Y,3713
105
+ privatelabbench/privacy/release.py,sha256=uPr-rs-3m7yU10scZY_iTjEXin4HEgFcESUBIwd5wcA,2228
106
+ privatelabbench/reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
+ privatelabbench/reports/integrity.py,sha256=Ebffvjzlvj6kSTJBd7eKJ_I4R2Ylytu1ghcQxH-zueg,4898
108
+ privatelabbench/reports/json.py,sha256=r6SFbWp6-9OZiv-YrqF8WNikbmX_dhPxiAbj3EjQHNQ,2404
109
+ privatelabbench/reports/manifest.py,sha256=0TZ5I7wAt6vsoPMOUxvIs8rXe2msaaGR9iQtdbeeiSE,7913
110
+ privatelabbench/reports/markdown.py,sha256=qAbSLCXwcgskcZlAgzINsCaFm91VHzavQSpR3g7GRCw,12018
111
+ privatelabbench/reports/paired_comparison.py,sha256=smQ58iEgxfx89FD-idspjppdapqNarX-yazHpLLuRy0,10651
112
+ privatelabbench/reports/receipt.py,sha256=hSI6G_lahkVm5ImtF-UzfwWrdXunZIJiiZHjq59WJCs,20607
113
+ privatelabbench/reports/trust.py,sha256=WJP0c6sQcOeryndkaFEIctb7pI6uedTD6wKQJj44_Ug,11766
114
+ privatelabbench/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
+ privatelabbench/tasks/molecules.py,sha256=vOjFq_xS7ZCZq4sg0-EFJNYLdajglyY-rh02SsXZt3U,2528
116
+ private_lab_bench-0.1.0.dist-info/METADATA,sha256=qOKWm7N3norp25S_JgxOeEj1Cr_AxPUFncWOv2kQtPs,14530
117
+ private_lab_bench-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
118
+ private_lab_bench-0.1.0.dist-info/entry_points.txt,sha256=CHxZzQDy4u-jfkVegfZuK9PYX_4YViWvCcHI0X6S8vw,92
119
+ private_lab_bench-0.1.0.dist-info/top_level.txt,sha256=MI3m0SYIx4gtarZsT8-VkpjQDy8eXRj7wfhjlXqEePo,16
120
+ private_lab_bench-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ plb = privatelabbench.cli:main
3
+ privatelabbench = privatelabbench.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dipesh Tharu Mahato
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ privatelabbench
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,12 @@
1
+ """Model and featurization adapters for PrivateLabBench."""
2
+
3
+ from privatelabbench.adapters.base import FingerprintAdapter, ModelAdapter
4
+ from privatelabbench.adapters.external_predictions import ExternalPredictionAdapter
5
+ from privatelabbench.adapters.sklearn_adapter import RandomForestMoleculeAdapter
6
+
7
+ __all__ = [
8
+ "FingerprintAdapter",
9
+ "ModelAdapter",
10
+ "ExternalPredictionAdapter",
11
+ "RandomForestMoleculeAdapter",
12
+ ]
@@ -0,0 +1,41 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Protocol
5
+
6
+ import numpy as np
7
+
8
+ from privatelabbench.core.interfaces import ModelAdapter
9
+
10
+
11
+ class FingerprintAdapter(Protocol):
12
+ """Converts molecule strings into model-ready feature arrays."""
13
+
14
+ name: str
15
+
16
+ def transform(self, smiles: list[str]) -> np.ndarray:
17
+ """Return a 2D feature matrix for a list of SMILES strings."""
18
+
19
+
20
+ @dataclass(frozen=True)
21
+ class AdapterSpec:
22
+ adapter: str = "hashed_random_forest"
23
+ fingerprint: str = "hashed"
24
+ n_bits: int = 256
25
+ radius: int = 2
26
+ n_estimators: int = 200
27
+
28
+ @classmethod
29
+ def from_config(cls, data: dict[str, object] | None) -> "AdapterSpec":
30
+ if not data:
31
+ return cls()
32
+ return cls(
33
+ adapter=str(data.get("adapter", "hashed_random_forest")),
34
+ fingerprint=str(data.get("fingerprint", data.get("featurizer", "hashed"))),
35
+ n_bits=int(data.get("n_bits", 256)),
36
+ radius=int(data.get("radius", 2)),
37
+ n_estimators=int(data.get("n_estimators", 200)),
38
+ )
39
+
40
+
41
+ __all__ = ["FingerprintAdapter", "ModelAdapter", "AdapterSpec"]
@@ -0,0 +1,25 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+
5
+ from privatelabbench.eval.predictions import evaluate_prediction_csv
6
+
7
+
8
+ @dataclass(frozen=True)
9
+ class ExternalPredictionAdapter:
10
+ """Adapter for customer-owned predictions generated outside PrivateLabBench."""
11
+
12
+ target_column: str
13
+ prediction_column: str
14
+ task_type: str | None = None
15
+ split_column: str | None = None
16
+ name: str = "external_predictions"
17
+
18
+ def evaluate_csv(self, csv_path: str):
19
+ return evaluate_prediction_csv(
20
+ csv_path,
21
+ target=self.target_column,
22
+ prediction_column=self.prediction_column,
23
+ task_type=self.task_type,
24
+ split_column=self.split_column,
25
+ )
@@ -0,0 +1,55 @@
1
+ from __future__ import annotations
2
+
3
+ import numpy as np
4
+
5
+ from privatelabbench.tasks.molecules import hashed_smiles_fingerprints
6
+
7
+
8
+ class HashedSmilesFingerprintAdapter:
9
+ name = "hashed_smiles"
10
+
11
+ def __init__(self, n_bits: int = 256) -> None:
12
+ self.n_bits = n_bits
13
+
14
+ def transform(self, smiles: list[str]) -> np.ndarray:
15
+ return hashed_smiles_fingerprints(smiles, n_bits=self.n_bits)
16
+
17
+
18
+ class RDKitMorganFingerprintAdapter:
19
+ name = "rdkit_morgan"
20
+
21
+ def __init__(self, radius: int = 2, n_bits: int = 2048) -> None:
22
+ self.radius = radius
23
+ self.n_bits = n_bits
24
+
25
+ def transform(self, smiles: list[str]) -> np.ndarray:
26
+ try:
27
+ from rdkit import Chem, DataStructs
28
+ from rdkit.Chem import AllChem
29
+ except ImportError as exc:
30
+ raise ImportError(
31
+ "RDKit support is optional. Install with `pip install private-lab-bench[rdkit]` "
32
+ "or install rdkit in the active environment."
33
+ ) from exc
34
+
35
+ rows: list[np.ndarray] = []
36
+ for smi in smiles:
37
+ mol = Chem.MolFromSmiles(smi)
38
+ if mol is None:
39
+ raise ValueError(f"RDKit could not parse SMILES value: {smi!r}")
40
+ fp = AllChem.GetMorganFingerprintAsBitVect(mol, self.radius, nBits=self.n_bits)
41
+ arr = np.zeros((self.n_bits,), dtype=np.float32)
42
+ DataStructs.ConvertToNumpyArray(fp, arr)
43
+ rows.append(arr)
44
+ if not rows:
45
+ return np.zeros((0, self.n_bits), dtype=np.float32)
46
+ return np.vstack(rows).astype(np.float32)
47
+
48
+
49
+ def build_fingerprint_adapter(name: str, *, n_bits: int = 256, radius: int = 2):
50
+ normalized = name.strip().lower().replace("-", "_")
51
+ if normalized in {"hashed", "hashed_smiles", "hash"}:
52
+ return HashedSmilesFingerprintAdapter(n_bits=n_bits)
53
+ if normalized in {"rdkit", "morgan", "rdkit_morgan"}:
54
+ return RDKitMorganFingerprintAdapter(radius=radius, n_bits=n_bits)
55
+ raise ValueError(f"Unsupported fingerprint adapter: {name}")