Skip to content

Commit

Permalink
fixed predict_classes in predict
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikko Kotila authored and Mikko Kotila committed Jan 28, 2022
1 parent 010a319 commit 2460100
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion talos/commands/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ def predict_classes(self, x, metric, asc, model_id=None):
'''

import numpy as np

if model_id is None:
from ..utils.best_model import best_model
model_id = best_model(self.scan_object, metric, asc)

from ..utils.best_model import activate_model
model = activate_model(self.scan_object, model_id)

return model.predict_classes(x)
# make (class) predictiosn with the model
preds = model.predict(x)
preds_classes = np.argmax(preds, axis=1)

return preds_classes

0 comments on commit 2460100

Please sign in to comment.