Calculates the accuracy of predictions and returns the result. Accuracy is the proportion of correct predictions out of all predictions made. It represents the overall correctness of the model. Accuracy = (True Positives + True Negatives) / Total. Scores are between 0 and 1 with a perfect accuracy being 1.
Parameters
Name
Type
Description
Default
y_true
array
The actual observed values (ground truth).
required
y_pred
array
The model predicted values.
required
Returns
Name
Type
Description
float
The calculated accuracy score, ranging from 0.0 to 1.0.