autonomio / talos

Hyperparameter Experiments with TensorFlow and Keras
https://autonom.io
MIT License
1.62k stars 270 forks source link

TypeError: unorderable types: list() >= float() for binary model #426

Closed romusters closed 4 years ago

romusters commented 4 years ago

1) Versions

python 3.5.2 talos.__version__ 0.6.4

2) Explain clearly what you expect to happen

I expected the evaluation of a binary below to run without error:

e= Evaluate(h)
evaluation = e.evaluate(testX,
                    testY,
                    model_id=None,
                    folds=5,
                    shuffle=True,
                    metric=criteria,
                    asc=True,
                    task="binary")

3) Explain what actually happened

Traceback (most recent call last):
  File "talos_conv.py", line 211, in <module>
    task="binary")
  File "/usr/local/lib/python3.5/dist-packages/talos/commands/evaluate.py", line 75, in evaluate
    y_pred = y_pred >= .5
TypeError: unorderable types: list() >= float()

5) Solution

In evaluate.py:

if task == 'binary':
    y_pred = y_pred >= .5

To:

if task == 'binary':
    y_pred = np.array(y_pred) >= .5
github-actions[bot] commented 4 years ago

Welcome to Talos community! Thanks so much for creating your first issue :)

mikkokotila commented 4 years ago

This is resolved so closing here.