On binary classifier, AutoKeras returns only one class's probability on predict call.
# model: is trained autokeras model
prob = model.predict(vector)
print(prob)
Data used by the code: Any binary classifier data
Expected Behavior.
It should return probabilities of all n classes.
For binary, it should print as [0.18029907, 0.41025335] but it prints [0.18029907]
For 3 classes it should print as [0.18029907, 0.41025335, 0.40944752] and it prints as expected [0.18029907, 0.41025335, 0.40944752]
When I convert the above prob into a pandas data frame, For the binary class it prints one column only and for multiple class datasets it prints n columns where n is the number of classes.
The issue is with binary classifiers only
Setup Details
OS type and version:
Python: >= 3.8
autokeras==1.0.19
keras-tuner:1.1.3
scikit-learn:1.2.0
numpy:1.22.4
pandas:1.3.0
tensorflow:2.11.0
Additional context
When I run it on multiple class datasets, then the predict call returns all class probability as expected
On binary classifier, AutoKeras returns only one class's probability on
predict
call.Data used by the code: Any binary classifier data
Expected Behavior.
It should return probabilities of all
n
classes. For binary, it should print as [0.18029907, 0.41025335] but it prints [0.18029907] For 3 classes it should print as [0.18029907, 0.41025335, 0.40944752] and it prints as expected [0.18029907, 0.41025335, 0.40944752]When I convert the above prob into a pandas data frame, For the binary class it prints one column only and for multiple class datasets it prints
n
columns wheren
is the number of classes. The issue is with binary classifiers onlySetup Details
Additional context
When I run it on multiple class datasets, then the
predict
call returns all class probability as expected