Skip to content

BernalFA/deepchem-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepChem-utils

 

Custom utility functions and classes for DL model exploration with DeepChem. Most of them are wrappers to existing DeepChem objects.

Features

  1. Dataset preparation wrapper for datasets with user-defined splits.
from deepchem_utils.dataset import prepare_dataset

train_dataset, valid_dataset, transformer = prepare_dataset(
    filepath=path_to_data,  # CSV
    model_name="GraphConvModel",
    valid_indices=valid_indices,
    test_indices=test_indices
)
  1. Hyperparameter optimization wrapper.
import deepchem as dc
from deepchem_utils.model_selection import run_hyperopt_search

f1 = dc.metrics.Metric(dc.metrics.f1_score)

run_hyperopt_search(
    model_name="GraphConvModel",
    train_dataset=train_dataset,
    valid_dataset=valid_dataset,
    params_dict=params_dict,
    metrics=f1,
    output_filepath="data",
    transformer=transformer
)
  1. Evaluation of models with optimized hyperparameters using a custom callback to define best number of epochs (pseudo-manual early stopping selection as deepchem does not has an implementation for it).
from deepchem_utils.model_selection import SelectEpochs

experiment = SelectEpochs(
    model_name="GraphConvModel",
    params=params,
    metrics=[f1],
    frequency=2,
    nb_epoch=100,
    output_file="data/GraphConvModel_valid_callback.csv"
)
experiment.repeated_evaluation(train_dataset, valid_dataset, transformer, n_times=5)

License

The content of this repo is licensed under the MIT license conditions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published