Commit cd68a32d authored by joegomes's avatar joegomes
Browse files

Remove Model and Transformer debug code

parent 3ba48112
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -147,10 +147,11 @@ class Model(object):
    batch_size = self.model_params["batch_size"]
    for (X_batch, y_batch, w_batch, ids_batch) in dataset.iterbatches(batch_size):

      # HACK(JG): This is a hack to perform 10-fold averaging of y_pred on
      # HACK(JG): This is a hack to perform n-fold averaging of y_pred on
      # a given X_batch.  If fit_transformers exist, we will apply them to
      # X_batch 10 times and average the resulting y_pred before we undo 
      # transforms on y_pred and y
      # X_batch 1 times and average the resulting y_pred before we undo 
      # transforms on y_pred and y.  In the future the averaging will be
      # performed n_sample times, where n_sample can be user-specified.

      if self.fit_transformers:

@@ -161,19 +162,12 @@ class Model(object):
          y_pred = np.reshape(y_pred, np.shape(y_b))
          y_preds.append(y_pred)

        #print(y_batch)
        #print(y_b)
        #print(y_preds)
        y_pred = np.array(y_preds).mean(axis=0)
        #print(y_pred)
        #break

      else:

        #print(y_batch)
        y_pred = self.predict_on_batch(X_batch)
        y_pred = np.reshape(y_pred, np.shape(y_batch))
        #print(y_pred)

      # Now undo transformations on y, y_pred

+2 −2
Original line number Diff line number Diff line
@@ -330,7 +330,7 @@ class CoulombBinarizationTransformer(Transformer):
    
    for _, row in df.iterrows(): 
      X = load_from_disk(row['X-transformed'])
      #self.feature_max = np.maximum(self.feature_max,X.max(axis=0))
      self.feature_max = np.maximum(self.feature_max,X.max(axis=0))

  def transform(self, dataset, parallel=False):

@@ -381,7 +381,7 @@ class CoulombBinarizationTransformer(Transformer):

    X_bin = []
    if self.update_state: 
      #self.set_max(df)
      self.set_max(df)
      self.update_state = False
    if self.transform_X:
      for i in range(X.shape[1]):