metrics for keras model

Solutions on MaxInterview for metrics for keras model by the best coders in the world

showing results for - "metrics for keras model"
Maxence
02 Jan 2020
1### Keras Regression Metrics
2# Below is a list of the metrics that you can use in Keras on regression problems.
3
4Mean Squared Error: mean_squared_error, MSE or mse
5Mean Absolute Error: mean_absolute_error, MAE, mae
6Mean Absolute Percentage Error: mean_absolute_percentage_error, MAPE, mape
7Cosine Proximity: cosine_proximity, cosine
8  
9### Keras Classification Metrics
10# Below is a list of the metrics that you can use in Keras on classification problems.
11
12Binary Accuracy: binary_accuracy, acc
13Categorical Accuracy: categorical_accuracy, acc
14Sparse Categorical Accuracy: sparse_categorical_accuracy
15Top k Categorical Accuracy: top_k_categorical_accuracy (requires you specify a k parameter)
16Sparse Top k Categorical Accuracy: sparse_top_k_categorical_accuracy (requires you specify a k parameter)
17  
18### Keras custom metrics for rmse
19from keras import backend
20 
21def rmse(y_true, y_pred):
22	return backend.sqrt(backend.mean(backend.square(y_pred - y_true), axis=-1))