File size: 2,196 Bytes
13a0ace
 
98ee0a8
 
 
 
 
 
 
13a0ace
98ee0a8
 
 
 
 
 
 
 
 
 
 
40978d6
98ee0a8
 
 
 
 
 
 
40978d6
 
98ee0a8
40978d6
 
 
 
98ee0a8
 
 
40978d6
 
 
 
 
 
 
 
98ee0a8
 
40978d6
 
 
 
 
 
98ee0a8
 
40978d6
 
 
 
 
 
 
 
98ee0a8
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
license: mit
tags:
  - PROTAC
  - drug-discovery
  - cheminformatics
  - regression
library_name: pytorch
pipeline_tag: tabular-regression
---

# PROTAC Synthesizability — MLP

A PyTorch MLP that predicts the **heavy-atom-count weighted synthesizability score**
(`hac_weighted_score`) of PROTAC molecules from SMILES.
Nested 5×5 scaffold cross-validation, Optuna tuning. **Mean CV R² = 0.598.**

## Files

- `mlp_v3_final.pt` — network weights + architecture
- `mlp_v3_final.skops` — fitted preprocessor + target transformer
- `mlp_v3_final_hparams.yaml` — hyperparameters

(`.pt` and `.skops` are both required to load the model.)

## Usage

Requires the project code: https://github.com/ribesstefano/PROTAC-Synthesizability

Install the package (editable) so `protac_synth` is importable, then:

```python
from protac_synth.models.mlp.model import TorchMLPRegressor
from protac_synth.chem_utils import (
    standardize_all, compute_fingerprints, compute_descriptors,
)

model  = TorchMLPRegressor.load("mlp_v3_final")   # base path, no extension
smiles = ["O=C(O)c1ccccc1"]

# featurization consumes standardized RDKit Mols, not raw SMILES
mols  = standardize_all(smiles)
preds = model.predict(
    smiles,
    X_fp=compute_fingerprints(mols, model.fp_size, model.fp_radius),
    X_desc=compute_descriptors(mols),
)
```

Notes:
- `compute_fingerprints` / `compute_descriptors` take pre-standardized Mols
  (from `standardize_all`), so each molecule is parsed and standardized once.
- Using `model.fp_size` / `model.fp_radius` guarantees the fingerprint settings
  match those the model was trained with.

## Dependencies

The `.skops` preprocessor and the RDKit descriptor set are **version-sensitive** —
loading under a different version can raise `InconsistentVersionWarning` or produce
a feature-count mismatch. Pin the versions the model was exported with:

- `scikit-learn==1.6.1` (the version the `.skops` pipeline was saved with)
- `rdkit` — pin the exact version used at training; the RDKit descriptor list
  changes across releases, and a mismatch changes the descriptor column count.
- `skops`, `torch`, `numpy` — pin to the training environment.

## License

MIT