Skip to content

Commit

Permalink
Merge pull request #564 from autonomio/fix_predict
Browse files Browse the repository at this point in the history
Fix predict
  • Loading branch information
mikkokotila committed Jan 28, 2022
2 parents 010a319 + dace33a commit 744b654
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion talos/commands/predict.py
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
4 changes: 4 additions & 0 deletions tests/commands/test_latest.py
@@ -1,5 +1,9 @@
def test_latest():

import warnings

warnings.simplefilter('ignore')

print('\n >>> start Latest Features... \n')

import talos
Expand Down

0 comments on commit 744b654

Please sign in to comment.