Keras Version
Do I have keras version 2 or 3?
The version of Keras depends on the installed version of tensorflow.
Before TensorFlow 2.16, installing TensorFlow would install Keras 2.
Starting with TensorFlow 2.16, installing
TensorFlow would install Keras 3.
Keras version 3 introduction:
https://keras.io/keras_3/
model metrics
https://keras.io/api/metrics/
The metrics that are available after running model.fit() depend upon the parameters given to
model.compile().
Regression Problem
model.compile(loss="mean_squared_error", optimizer="adam")
model.fit(..)
print("model.metrics_names",model.metrics_names)
model.metrics_names ['loss']
model.compile(loss="mean_squared_error", optimizer="adam", metrics=["RootMeanSquaredError"])
model.fit(..)
print("model.metrics_names",model.metrics_names)
model.metrics_names ['loss', 'root_mean_squared_error']
Classification Problem
model.compile(loss="binary_crossentropy", optimizer="adam", metrics=["accuracy"])
model.fit(..)
print("model.metrics_names",model.metrics_names)
model.metrics_names ['loss', 'accuracy']
Note:
Accuracy is typically used for classification tasks, whereas Mean Squared Error is more commonly used for
regression tasks.