Unverified Commit 3d926441 authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #1503 from peastman/pdbbind

Fixed errors running PDBBind example code
parents 015254c3 6d659896
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -302,6 +302,9 @@ class Metric(object):
    for task in range(n_tasks):
      y_task = y_true[:, task]
      y_pred_task = y_pred[:, task]
      if len(w.shape) == 1:
        w_task = w
      else:
        w_task = w[:, task]

      metric_value = self.compute_singletask_metric(y_task, y_pred_task, w_task)
+2 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ def load_pdbbind(featurizer="grid",
      # PDB code, resolution, release year, -logKd/Ki, Kd/Ki, reference, ligand name
      line = line.split()
      # The base-10 logarithm, -log kd/pk
      log_label = line[3]
      log_label = float(line[3])
      labels.append(log_label)
  labels = np.array(labels)
  # Featurize Data
@@ -278,6 +278,7 @@ def load_pdbbind(featurizer="grid",
                                                      protein_files)
  # Delete labels for failing elements
  labels = np.delete(labels, failures)
  labels = labels.reshape((len(labels), 1))
  dataset = deepchem.data.DiskDataset.from_numpy(features, labels)
  print('Featurization complete.')
  # No transformations of data