ML Models¶
This section summarizes the machine learning (ML) models used in PolyDrug to predict the solubility parameter δ and the mass density ρ.
ML Workflow¶
The machine learning workflow follows the approach described in our published study.[1] A combined dataset of small molecules and polymers was prepared, and each entry was represented using molecular, quantum-chemical, and chain-related descriptors. For polymers, repeating-element representations were used so that polymer structures could be encoded in a form suitable for descriptor generation.[2]
The overall workflow includes dataset preparation, descriptor calculation, feature selection, model training, and model evaluation. Feature engineering showed that molecular descriptors and chain-related descriptors contributed significantly to solubility parameter prediction. The models in PolyDrug therefore use molecular descriptors calculated with PaDEL[3], which can be calculated on demand from a SMILES string, together with the DOP as the chain-length descriptor. The quantum-chemical descriptors are not used because they cannot be calculated in real time, and the chain descriptors calculated with Materials Studio are not used because they require the commercial Materials Studio software.
Figure 1: The workflow figure summarizes the main steps used in the study, from molecular representation and descriptor generation to feature selection and predictive modeling.
Pearson Correlation Coefficient (PCC)¶
To identify the most relevant input variables, Pearson correlation coefficient (PCC) analysis was used. The Pearson correlation coefficient measures the strength and direction of the linear relationship between two continuous variables, with values ranging from -1 to +1. A value of +1 indicates a perfect positive linear relationship, -1 indicates a perfect negative linear relationship, and 0 indicates no linear correlation.
The coefficient is defined as:
In this expression, \(r\) is the correlation coefficient, \(x_i\) and \(y_i\) are the observed values, and \(\bar{x}\) and \(\bar{y}\) are the corresponding mean values. In the feature selection workflow, PCC was used to evaluate the linear correlation between each descriptor and the target solubility parameter. Only descriptors showing moderate or strong correlation (|PCC| ≥ 0.5) were retained, which in the published study reduced the feature set to 43 descriptors and removed weak or redundant variables.[1] For the models in PolyDrug (version 2.2.0), the same criterion applied to the current training set retains 53 descriptors (see Training Data). The PCC figure below shows these descriptors, i.e., the descriptors most strongly related to the solubility parameter that are used as model inputs.
Figure 2: Pearson correlation coefficient r of the 53 descriptors selected for the PolyDrug models (version 2.2.0) on the training set (|r| ≥ 0.5, dashed lines): 35 correlate positively and 18 negatively with the solubility parameter. Together with the DOP, they form the 54 inputs of the GPR and RF models. Further details of the descriptors are available in Refs. [1,3]
Models in PolyDrug¶
The models in PolyDrug (version 2.2.0) follow this workflow and were trained on the MD data of the PolyDrug database.
Training Data¶
- Entries: one entry per compound and degree of polymerization (DOP), with the mean δ and the mean ρ of all MD runs of this compound and DOP in the database. In total, 330 entries: 164 small molecules, 13 drugs and 79 polymers at 153 polymer–DOP combinations.
- Descriptors: PaDEL 2D descriptors[3] of the SMILES plus the DOP, calculated in the same way as for a SMILES entered in PolyDrug. A polymer is represented by one repeating unit whose two open bonds are saturated with hydrogen, because PaDEL cannot handle open bonds. The cut is fixed for each polymer, e.g.,
*COC*(dimethyl ether) for PEG. For the polymers of Ref. [1], these are the same molecules as its repeating elements, except PLA, which now uses its repeating unit (2-hydroxypropanal) instead of methyl acetate. - Not included: the random copolymers PLGA 20:80 and PLGA 50:50, because a repeating-unit SMILES cannot describe a random sequence.
- Test set: 64 small molecules and polymers. They are the test entries of the previous version (2.1.0, a random 80/20 split), kept so that the versions can be compared. The other 266 entries, including the drugs, are used for training.
- Preprocessing: descriptor columns that are zero for all entries are removed and infinite values are treated as missing, which leaves 1138 candidate features (including the DOP). Missing values are replaced by the training mean, and all features are standardized with the mean and standard deviation of the training set. Descriptors with |PCC| ≥ 0.5 on the training set are selected, and the DOP is always kept: 53 descriptors plus the DOP (54 inputs) for the δ models and 91 descriptors plus the DOP (92 inputs) for the density model.
Gaussian Process Regression (GPR)¶
GPR is the default model on the Solubility Parameter tab and the model of the FH Parameter, Miscibility and Phase Diagram modules.
- Kernel: Matérn kernel (ν = 1.5) plus a white-noise kernel, α = 10−2, normalized target values, 10 optimizer restarts.
- Optimized values: length scale ℓ = 7.43, noise level 1.0 × 10−5.
Figure 3: GPR model: δ predicted by ML versus δ from MD for the training (blue) and test (red) entries; the drugs (training entries) are shown as diamonds. MAE and RMSE are given in MPa1/2. Formic acid (38.2 MPa1/2) and water (53.1 MPa1/2), both training entries, lie outside the plotted range.
Random Forest (RF)¶
As a tree-based ensemble method, RF captures nonlinear relationships between the descriptors and the target property. It is less prone to overfitting than a single decision tree. RF can be selected on the Solubility Parameter tab.
- Hyperparameters: the number of trees (10–290) and the maximum depth (10–90) were chosen by a grid search with 5-fold cross-validation on the training set: 270 trees, maximum depth 10.
Figure 4: RF model: δ predicted by ML versus δ from MD for the training (blue) and test (red) entries; the drugs (training entries) are shown as diamonds. MAE and RMSE are given in MPa1/2. Formic acid and water lie outside the plotted range.
Density Model¶
The mass density ρ is predicted with a GPR model with the same settings, trained on the MD densities of the same entries (optimized length scale ℓ = 11.9, noise level 0.0252). The density gives the unit volume \(V = M / (\rho N_A)\) (molecular weight \(M\) of the molecule or repeating unit, Avogadro constant \(N_A\)). The unit volume is used in the FH Parameter, Miscibility and Phase Diagram modules.
Performance¶
| Model | Target | Inputs | Train R2 | Train MAE | Train RMSE | Test R2 | Test MAE | Test RMSE |
|---|---|---|---|---|---|---|---|---|
| GPR | δ (MPa1/2) | 54 | 0.997 | 0.123 | 0.227 | 0.956 | 0.477 | 0.803 |
| RF | δ (MPa1/2) | 54 | 0.951 | 0.340 | 0.942 | 0.921 | 0.723 | 1.074 |
| GPR (density) | ρ (g/cm3) | 92 | 0.979 | 0.016 | 0.031 | 0.981 | 0.021 | 0.032 |
Training set: 266 entries; test set: 64 entries. The parity plots above give the same values rounded to two decimals.
Drugs¶
The 13 drugs of the database are part of the training data. To check how well a new drug is predicted, each drug was left out in turn: the models were trained without it, otherwise as above (RF with the 270 trees and maximum depth 10 of the final model), and then predicted its δ (leave-one-drug-out).
| Version | GPR MAE | RF MAE |
|---|---|---|
| 2.2.0, leave-one-drug-out | 2.33 | 1.82 |
| 2.1.0, drugs not used for training | 3.70 | 2.97 |
MAE of the 13 drugs in MPa1/2, compared with the MD values of the database.
Figure 5: δ of the 13 drugs predicted by GPR and RF in the leave-one-drug-out test versus δ from MD.
For 11 of the 13 drugs, the GPR error is at most 3.3 MPa1/2 (MAE 1.5 MPa1/2). The two most polar drugs, myricetin and favipiravir, are predicted about 7 MPa1/2 too low (see Limitations). RF predicts these two drugs better, but it is less accurate for the other drugs (MAE 1.9 MPa1/2) and for the test set (MAE 0.72 versus 0.48 MPa1/2). PolyDrug therefore uses GPR.
Polymers Not in the Database¶
The test set was drawn over entries, so a test polymer can also be in the training set at another DOP. To check how well a new polymer is predicted, the other DOPs of the test polymers were also removed from training (266 → 234 training entries), and the models were retrained with the same steps.
| GPR, test set | R2 | MAE (MPa1/2) |
|---|---|---|
| All 64 entries | 0.96 → 0.85 | 0.48 → 0.88 |
| 31 polymers | 0.94 → 0.65 | 0.60 → 1.44 |
| 33 small molecules | – | 0.36 → 0.35 |
Figure 6: δ of the 31 test polymers predicted by GPR versus δ from MD. Random split: the test set as above; grouped split: the other DOPs of the test polymers also removed from training. The labeled polymers have an error larger than 2 MPa1/2 in the grouped split. MAE and RMSE are given in MPa1/2.
Where the Models Are Used¶
| Module | δ | Unit volume |
|---|---|---|
| Solubility Parameter | GPR (default) or RF, as selected by the user | – |
| FH Parameter, Miscibility, Phase Diagram | MD database; otherwise GPR | MD database; otherwise the experimental density from PubChem (small molecules) or the density model |
Limitations¶
- Predicted δ values: in the FH Parameter, Miscibility and Phase Diagram modules, PolyDrug uses the δ from the MD simulations for every compound and DOP in the database. δ is predicted by the ML model for compounds that are not in the database (e.g., a new SMILES) and for a DOP without MD runs.
- Very polar drugs: in the leave-one-drug-out test, GPR predicts the two most polar drugs, myricetin and favipiravir (δ from MD 29.1 and 32.1 MPa1/2), about 7 MPa1/2 too low. The δ of very polar new drugs can therefore be much too low.
- New polymers: for a polymer that is not in the database at any DOP, the expected δ error is about 1.4 MPa1/2 (GPR, see Polymers Not in the Database).
- Random copolymers: a repeating-unit SMILES cannot describe a random copolymer such as PLGA. Use the database entries (PLGA 20:80, PLGA 50:50) at their simulated DOP (198 and 184) instead of a SMILES.
- Polymer SMILES depend on the cut: each
*in an entered SMILES is replaced by a hydrogen where it is placed, so different cuts of the same chain give different molecules and predictions. For PEG at DOP 50,*COC*(dimethyl ether) gives 20.2 MPa1/2 and*OCC*(ethanol) 23.3 MPa1/2 (MD: 20.5 MPa1/2). For a polymer in the database, select it by name: then its stored repeating unit is used and, at a simulated DOP, its MD value is shown. A SMILES with*is not matched to a database entry. - Very polar small molecules: water and formic acid are the most polar molecules in the training data, and their δ is outside the range of the other entries. Predictions for similar molecules are uncertain.
References¶
-
George A, Sierka M. Machine Learning Meets Molecular Dynamics: Accurate Prediction of Polymer Solubility Parameters. Advanced Theory and Simulations. 2026;9(3):e01865. https://doi.org/10.1002/adts.202501865
-
Chi M, Gargouri R, Schrader T, Damak K, Maalej R, Sierka M. Atomistic Descriptors for Machine Learning Models of Solubility Parameters for Small Molecules and Polymers. Polymers. 2022;14(1):26. https://doi.org/10.3390/polym14010026
-
Yap CW. PaDEL-descriptor: An open source software to calculate molecular descriptors and fingerprints. Journal of Computational Chemistry. 2011;32(7):1466-1474. https://doi.org/10.1002/jcc.21707
