--- license: mit tags: - toxicity - dili - liver-toxicity - qsar - sklearn - deployment-refit --- # Liver toxicity (DILI) — ExtraTrees deployment model Binary classifier for drug-induced liver injury (DILI) concern: the probability that a compound belongs to the toxic class. This is the **deployment refit** of the liver programme's Arch3 LazyPredict-best model (ExtraTrees), one of the two winners selected on the locked regulatory benchmark. It is deployed as a pair with the GAT deployment model (`Delower/liver-gat-deployment`); a compound flagged by **both** models is the highest-concern readout. ## Recipe - Model: `ExtraTreesClassifier` with scikit-learn defaults and `random_state=42` — the arm's own recipe, reused unchanged with **no re-tuning**. - Features (`fp_desc`, 1,404 columns): Morgan fingerprint bits (1024) + MACCS keys (167) + RDKit descriptors prepared by the arm's `DescPrep` (fit on the full deployment set; shipped inside the weights bundle). - Flag threshold: probability ≥ 0.5 (the arm's own convention). ## Deployment training set All labeled liver data the programme holds, identity-deduped by InChIKey connectivity of the standardized parent: **1,891 unique compounds** (1,003 positive / 888 negative), composed of train_locked.csv (1,769 rows) + train_enriched.csv additions + internal_test.csv + **every regulatory benchmark compound** (withdrawn, clinical failures, PASS), with benchmark labels governing conflicts. 1,769 duplicate rows dropped; 42 label conflicts (all inside train_locked, the groups the earlier merge had excluded) kept at the first train_locked row's label and logged. **Hard gate (passed before training):** every deduped regulatory benchmark compound was verified compound-by-compound (InChIKey connectivity) inside the actual training matrix, post-featurization: withdrawn **71/71**, clinical failures **10/10**, PASS **304/304**. See `gate_verification.json`. ## Honest benchmark scores — benchmark version only The deployment refit absorbed the regulatory benchmark and is **never scored on it**. The frozen claim for this recipe comes from the locked-wave benchmark model (benchmark locked out of training, overlap verified 0; 385 scored compounds): | Metric | Value | |---|---| | Pooled regulatory AUROC | 0.690 | | Pooled balanced accuracy | 0.623 | | Withdrawn drugs caught | 65/71 | | Clinical failures caught | 10/10 | | PASS compounds correct | 97/304 (0.319) | ## Deployment screen results Applied to the DPP-4 programme's potent leads (flag = prob ≥ 0.5): 1,113/1,113 workbook leads scored, 1,082 flagged (97.5%); 4,898/4,898 of the full potent union scored, 4,722 flagged (96.5%). These flag rates are high — every model in this programme is a high-sensitivity, low-specificity screen, and the pair's discriminative readout is the dual flag (1,003/1,110 leads flagged by both models; only 6 pass both). Treat single-model flags as low-information on their own. ## Files - `model.joblib` — joblib bundle: the fitted `ExtraTreesClassifier`, the fitted `DescPrep` preprocessing object, and the feature-block kind. Unpickling requires `deployment_common.py` (shipped here) to be importable. - `config.json` — recipe, training composition, gate counts, benchmark scores. - `deployment_common.py` — the programme's shared featurization module (fingerprints, descriptors, `DescPrep`). - `infer.py` — prediction entry point (`predict(smiles)`). - `validate.py` + `examples.json` — runnable validation: reproduces this model's probabilities on 8 screened DPP-4 leads (tolerance 1e-6; the model is deterministic). Verified locally before upload: max deviation 0. - `gate_verification.json`, `training_manifest.json` — hard-gate result and full training manifest. - `absorbed_compounds.csv` — the 1,891-compound deployment training set (the absorbed data, for audit). ## Limitations Requires `scikit-learn`, `rdkit`, `joblib`, `numpy`. Probabilities are screening scores, not calibrated clinical risks.