I am trying to generate class scores by calling predict_proba()
of Keras model, but it seems that this function does not exist! Is it deprecated because I see some examples in Google? I am using Keras 2.2.2.
The predict_proba() method The method accepts a single argument that corresponds to the data over which the probabilities will be computed and returns an array of lists containing the class probabilities for the input data points.
The predict_proba()
and predict_classes()
methods are not well-defined for models created using functional API (i.e. keras.models.Model()
). That's because the models created using functional API may have multiple output layers each with different configurations. Therefore predicting probabilities in this case is not meaningful, even if your model outputs probabilities. The method you referred to, as well as predict_classes()
, is only defined for Sequential models (i.e. keras.models.Sequential()
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With