Google News
logo
Keras - Interview Questions
What is a metric in Keras?
In Keras, a metric is a function used to evaluate the performance of a neural network model during training and/or evaluation. Metrics provide quantitative measures of how well the model is performing on a given task, such as classification accuracy, mean squared error, precision, recall, etc.

Metrics are typically specified when compiling a Keras model using the compile() function. They are used to monitor the model's performance during training and can be displayed in the training output to track progress.

Here are some common metrics used in Keras :

* Accuracy : Measures the proportion of correctly classified samples out of the total number of samples. It is commonly used for classification tasks.

* Mean Squared Error (MSE) : Calculates the average of the squared differences between the predicted values and the true values. It is commonly used for regression tasks.

* Mean Absolute Error (MAE) : Calculates the average of the absolute differences between the predicted values and the true values. It is another metric commonly used for regression tasks.

* Precision : Measures the proportion of true positive predictions out of all positive predictions. It is commonly used in binary classification tasks.

* Recall (Sensitivity) : Measures the proportion of true positive predictions out of all actual positive samples. It is also commonly used in binary classification tasks.

* F1 Score : Harmonic mean of precision and recall, providing a single metric that balances both precision and recall.

* AUC (Area Under the ROC Curve) : Measures the area under the Receiver Operating Characteristic (ROC) curve, which plots the true positive rate against the false positive rate.

* Categorical Crossentropy : Measures the cross-entropy loss between the true labels and the predicted probabilities for multi-class classification tasks.
Advertisement