Skip to content

Commit

Permalink
Cast data as np array in test tf model.
Browse files Browse the repository at this point in the history
  • Loading branch information
dickensc committed Mar 15, 2024
1 parent 30e012f commit 4a62a96
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def internal_fit(self, data, gradients, options = {}):

def internal_predict(self, data, options = {}):
data = self._prepare_data(data)
predictions = self._model.predict(data[0], verbose=0)
predictions = self._model.predict(numpy.array(data[0]), verbose=0)
return predictions, {}

def internal_eval(self, data, options = {}):
Expand All @@ -82,7 +82,7 @@ def _prepare_data(self, data):
if len(data) == 2:
return data

return [numpy.asarray(data[:,:-1]), numpy.asarray([[1, 0] if label == 0 else [0, 1] for label in data[:,-1]])]
return [numpy.asarray(data[:, :-1]), numpy.asarray([[1, 0] if label == 0 else [0, 1] for label in data[:,-1]])]


def calculate_metrics(y_pred, y_truth, metrics):
Expand Down

0 comments on commit 4a62a96

Please sign in to comment.