Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -140,7 +140,7 @@ then, from within python load the datasets library
|
|
| 140 |
|
| 141 |
and load one of the `Molecule3D` datasets, e.g.,
|
| 142 |
|
| 143 |
-
>>> Molecule3D = datasets.load_dataset('maomlab/Molecule3D', name = 'Molecule3D_random_split')
|
| 144 |
README.md: 100% 4.95k/4.95k [00:00<00:00, 559kB/s]
|
| 145 |
Generating train split: 100% 2339788/2339788 [00:34<00:00, 85817.85 examples/s]
|
| 146 |
Generating test split: 100% 779930/779930 [00:15<00:00, 96660.33 examples/s]
|
|
@@ -164,6 +164,50 @@ and inspecting the dataset
|
|
| 164 |
})
|
| 165 |
})
|
| 166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
## Citation
|
| 168 |
@misc{https://doi.org/10.48550/arxiv.2110.01717,
|
| 169 |
doi = {10.48550/ARXIV.2110.01717},
|
|
|
|
| 140 |
|
| 141 |
and load one of the `Molecule3D` datasets, e.g.,
|
| 142 |
|
| 143 |
+
>>> Molecule3D = datasets.load_dataset('maomlab/Molecule3D', name = 'Molecule3D_random_split') # can put 'Molecule3D_scaffold_split' for the name as well
|
| 144 |
README.md: 100% 4.95k/4.95k [00:00<00:00, 559kB/s]
|
| 145 |
Generating train split: 100% 2339788/2339788 [00:34<00:00, 85817.85 examples/s]
|
| 146 |
Generating test split: 100% 779930/779930 [00:15<00:00, 96660.33 examples/s]
|
|
|
|
| 164 |
})
|
| 165 |
})
|
| 166 |
|
| 167 |
+
|
| 168 |
+
### Use a dataset to train a model
|
| 169 |
+
One way to use the dataset is through the [MolFlux](https://exscientia.github.io/molflux/) package developed by Exscientia.
|
| 170 |
+
First, from the command line, install `MolFlux` library with `catboost` and `rdkit` support
|
| 171 |
+
|
| 172 |
+
pip install 'molflux[catboost,rdkit]'
|
| 173 |
+
|
| 174 |
+
then load, featurize, split, fit, and evaluate the catboost model
|
| 175 |
+
|
| 176 |
+
import json
|
| 177 |
+
from datasets import load_dataset
|
| 178 |
+
from molflux.datasets import featurise_dataset
|
| 179 |
+
from molflux.features import load_from_dicts as load_representations_from_dicts
|
| 180 |
+
from molflux.splits import load_from_dict as load_split_from_dict
|
| 181 |
+
from molflux.modelzoo import load_from_dict as load_model_from_dict
|
| 182 |
+
from molflux.metrics import load_suite
|
| 183 |
+
|
| 184 |
+
split_dataset = load_dataset('maomlab/Molecule3D', name = 'Molecule3D_random_split') # can put 'Molecule3D_scaffold_split' for the name as well
|
| 185 |
+
|
| 186 |
+
split_featurised_dataset = featurise_dataset(
|
| 187 |
+
split_dataset,
|
| 188 |
+
column = "SMILES",
|
| 189 |
+
representations = load_representations_from_dicts([{"name": "morgan"}, {"name": "maccs_rdkit"}]))
|
| 190 |
+
|
| 191 |
+
model = load_model_from_dict({
|
| 192 |
+
"name": "cat_boost_regressor",
|
| 193 |
+
"config": {
|
| 194 |
+
"x_features": ['SMILES::morgan', 'SMILES::maccs_rdkit'],
|
| 195 |
+
"y_features": ['Solubility']}})
|
| 196 |
+
|
| 197 |
+
model.train(split_featurised_dataset["train"])
|
| 198 |
+
preds = model.predict(split_featurised_dataset["test"])
|
| 199 |
+
|
| 200 |
+
regression_suite = load_suite("regression")
|
| 201 |
+
|
| 202 |
+
scores = regression_suite.compute(
|
| 203 |
+
references=split_featurised_dataset["test"]['Solubility'],
|
| 204 |
+
predictions=preds["cat_boost_regressor::Solubility"])
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
|
| 211 |
## Citation
|
| 212 |
@misc{https://doi.org/10.48550/arxiv.2110.01717,
|
| 213 |
doi = {10.48550/ARXIV.2110.01717},
|