tf.keras.metrics.top_k_categorical_accuracy

Computes how often targets are in the top K predictions.

Main aliases

tf.metrics.top_k_categorical_accuracy

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.keras.metrics.top_k_categorical_accuracy

y_true The ground truth values.
y_pred The prediction values.
k (Optional) Number of top elements to look at for computing accuracy. Defaults to 5.

Top K categorical accuracy value.