Commit a44cce21 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Merge branch 'master' of https://github.com/deepchem/deepchem into new_datasets

parents 6387e4c4 9577759e
Loading
Loading
Loading
Loading
+23 −8
Original line number Diff line number Diff line
@@ -244,16 +244,22 @@ Scaffold splitting
* Regression

|Dataset         |Model               |Splitting   |Train score/R2|Valid score/R2|
|-----------|--------------------|------------|--------------|--------------|
|----------------|--------------------|------------|--------------|--------------|
|delaney         |MT-NN regression    |Index       |0.773         |0.574         |
|                |graphconv regression|Index       |0.991         |0.825         |
|                |MT-NN regression    |Random      |0.769         |0.591         |
|                |graphconv regression|Random      |0.996         |0.873         |
|                |MT-NN regression    |Scaffold    |0.782         |0.426         |
|                |graphconv regression|Scaffold    |0.994         |0.606         |
|nci        |MT-NN regression    |Index       |0.890         |0.890         |
|           |MT-NN regression    |Random      |0.891         |0.888         |
|           |MT-NN regression    |Scaffold    |0.912         |0.020         |
|nci             |MT-NN regression    |Index       |0.171         |0.062         |
|                |graphconv regression|Index       |0.123         |0.048         |
|                |MT-NN regression    |Random      |0.168         |0.085         |
|                |graphconv regression|Random      |0.117         |0.076         |
|                |MT-NN regression    |Scaffold    |0.180         |0.052         |
|                |graphconv regression|Scaffold    |0.131         |0.046         |
|pdbbind(core)   |MT-NN regression    |Random      |0.973         |0.494         |
|pdbbind(refined)|MT-NN regression    |Random      |0.987         |0.503         |
|pdbbind(full)   |MT-NN regression    |Random      |0.983         |0.528         |
|kaggle          |MT-NN regression    |User-defined|0.748         |0.452         |

* General features
@@ -261,7 +267,7 @@ Scaffold splitting
Number of tasks and examples in the datasets

|Dataset         |N(tasks)	|N(samples) |
|-----------|-----------|-----------| 
|----------------|-----------|-----------| 
|tox21           |12         |8014       |
|muv             |17         |93127      |
|pcba            |128        |439863     |
@@ -269,12 +275,17 @@ Number of tasks and examples in the datasets
|toxcast         |617        |8615       |
|delaney         |1          |1128       |
|kaggle          |15         |173065     |
|nci        |60         |1057371    |
|nci             |60         |19127      |
|pdbbind(core)   |1          |195        |
|pdbbind(refined)|1          |3706       |
|pdbbind(full)   |1          |11908      |



Time needed for benchmark test(~20h in total)

|Dataset         |Model               |Time(loading)/s |Time(running)/s|
|-----------|--------------------|----------------|---------------| 
|----------------|--------------------|----------------|---------------| 
|tox21           |logistic regression |30              |60             |
|                |Multitask network   |30              |60             |
|                |robust MT-NN        |30              |90             |
@@ -297,7 +308,11 @@ Time needed for benchmark test(~20h in total)
|                |graph convolution   |80              |900            |
|delaney         |MT-NN regression    |10              |40             |
|                |graphconv regression|10              |40             |
|nci        |MT-NN regression    |2000            |30000          |
|nci             |MT-NN regression    |400             |1200           |
|                |graphconv regression|400             |2500           |
|pdbbind(core)   |MT-NN regression    |0(featurized)   |30             |
|pdbbind(refined)|MT-NN regression    |0(featurized)   |40             |
|pdbbind(full)   |MT-NN regression    |0(featurized)   |60             |
|kaggle          |MT-NN regression    |2200            |3200           |


+19127 −0

File added.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -269,6 +269,7 @@ class MolecularWeightSplitter(Splitter):
    """

    np.testing.assert_almost_equal(frac_train + frac_valid + frac_test, 1.)
    if not seed is None:
      np.random.seed(seed)

    mws = []
@@ -299,6 +300,7 @@ class RandomSplitter(Splitter):
    Splits internal compounds randomly into train/validation/test.
    """
    np.testing.assert_almost_equal(frac_train + frac_valid + frac_test, 1.)
    if not seed is None:
      np.random.seed(seed)
    num_datapoints = len(dataset)
    train_cutoff = int(frac_train * num_datapoints)
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ def load_sdf_files(input_files):
    raw_df = next(load_csv_files([input_file+".csv"], shard_size=None))
    # Structures are stored in .sdf file
    print("Reading structures from %s." % input_file)
    suppl = Chem.SDMolSupplier(str(input_file), removeHs=False)
    suppl = Chem.SDMolSupplier(str(input_file), False, False, False)
    df_rows = []
    for ind, mol in enumerate(suppl):
      if mol is not None:
+21 −9
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ on datasets: muv, pcba, tox21, sider, toxcast
Giving regression performances of:
    MultitaskDNN(tf_regression),
    Graph convolution regression(graphconvreg)
on datasets: delaney, nci, kaggle
on datasets: delaney, nci, kaggle, pdbbind

time estimation listed in README file

@@ -49,6 +49,7 @@ from sider.sider_datasets import load_sider
from kaggle.kaggle_datasets import load_kaggle
from delaney.delaney_datasets import load_delaney
from nci.nci_datasets import load_nci
from pdbbind.pdbbind_datasets import load_pdbbind_grid

def benchmark_loading_datasets(hyper_parameters, 
                               dataset='tox21', model='tf', split=None,
@@ -74,7 +75,7 @@ def benchmark_loading_datasets(hyper_parameters,
  
  if dataset in ['muv', 'pcba', 'tox21', 'sider', 'toxcast']:
    mode = 'classification'
  elif dataset in ['kaggle', 'delaney', 'nci']:
  elif dataset in ['kaggle', 'delaney', 'nci','pdbbind']:
    mode = 'regression'
  else:
    raise ValueError('Dataset not supported')
@@ -91,7 +92,19 @@ def benchmark_loading_datasets(hyper_parameters,
  
  if dataset in ['kaggle']:
    featurizer = None #kaggle dataset use its own features
    if split in ['random', 'scaffold']:
      return
    else:
      split = None #kaggle dataset is already splitted
    if not model in ['tf_regression']:
      return

  if dataset in ['pdbbind']:
    featurizer = 'grid' #pdbbind use grid featurizer
    if split in ['scaffold', 'index']:
      return #skip the scaffold and index splitting of pdbbind
    if not model in ['tf_regression']:
      return
  
  if not split in [None, 'index','random','scaffold']:
    raise ValueError('Splitter function not supported')
@@ -99,7 +112,8 @@ def benchmark_loading_datasets(hyper_parameters,
  loading_functions = {'tox21': load_tox21, 'muv': load_muv,
                       'pcba': load_pcba, 'nci': load_nci,
                       'sider': load_sider, 'toxcast': load_toxcast,
                       'kaggle': load_kaggle, 'delaney': load_delaney}
                       'kaggle': load_kaggle, 'delaney': load_delaney,
                       'pdbbind': load_pdbbind_grid}
  
  print('-------------------------------------')
  print('Benchmark %s on dataset: %s' % (model, dataset))
@@ -117,7 +131,7 @@ def benchmark_loading_datasets(hyper_parameters,
  train_dataset, valid_dataset, test_dataset = all_dataset
  time_finish_loading = time.time()
  #time_finish_loading-time_start is the time(s) used for dataset loading
  if dataset in ['kaggle']:
  if dataset in ['kaggle','pdbbind']:
    n_features = train_dataset.get_data_shape()[0]
    #kaggle dataset has customized features
    
@@ -137,7 +151,7 @@ def benchmark_loading_datasets(hyper_parameters,
    time_finish_fitting = time.time()
    
    
    with open(os.path.join(out_path, 'results.csv'),'ab') as f:
    with open(os.path.join(out_path, 'results.csv'),'a') as f:
      writer = csv.writer(f)
      if mode == 'classification':
        for i in train_score:
@@ -497,7 +511,7 @@ if __name__ == '__main__':
           'tf_regression, graphconvreg')
  parser.add_argument('-d', action='append', dest='dataset_args', default=[], 
      help='Choice of dataset: tox21, sider, muv, toxcast, pcba, ' + 
           'kaggle, delaney, nci')
           'kaggle, delaney, nci, pdbbind')
  args = parser.parse_args()
  #Datasets and models used in the benchmark test
  splitters = args.splitter_args
@@ -511,7 +525,7 @@ if __name__ == '__main__':
              'tf_regression', 'graphconvreg']
  if len(datasets) == 0:
    datasets = ['tox21', 'sider', 'muv', 'toxcast', 'pcba', 
                'delaney', 'kaggle', 'nci']
                'delaney', 'nci', 'kaggle', 'pdbbind']

  #input hyperparameters
  #tf: dropouts, learning rate, layer_sizes, weight initial stddev,penalty,
@@ -562,8 +576,6 @@ if __name__ == '__main__':
            benchmark_loading_datasets(
                hps, dataset=dataset, model=model, split=split, out_path='.')
      else:
        if dataset in ['kaggle']:
          datasets.remove('kaggle') #kaggle only needs to be run once
        for model in models:
          if model in ['tf_regression', 'graphconvreg']:
            benchmark_loading_datasets(
Loading