Skip to content

Tensorflow Accuracy Metrics #887

Answered by Mattral
eishwezin20 asked this question in Q&A
Discussion options

You must be logged in to vote

In your code, you're using a regression-like model with Mean Squared Error (MSE) as the loss function.
When you use metrics=['accuracy'] in this context, it calculates unusual accuracy values because it doesn't make sense for regression problems.
If you're doing classification, ensure your model architecture, loss function (use categorical cross-entropy), and output layer are set up correctly.
If you're doing regression, use appropriate regression metrics like Mean Absolute Error (MAE) or Root Mean Squared Error (RMSE) for evaluation, not accuracy.

if you encounter situations where y_true and y_pred have shapes like [n, 1] (2-dimensional arrays with a single column), you may need to resha…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eishwezin20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants