Accuracy Score Calculation
Core Metrics DS practice problem on Onlearn.
Difficulty: medium.
Topics: Accuracy Score Calculation, True Positives, False Negatives, Class Imbalance Bias, Zero-One Loss Function, Prediction Thresholding, Model Evaluation & Selection, Statistical Learning Theory, Supervised Learning, Data Preprocessing, Performance Benchmarking, Classification Metrics, Confusion Matrix Analysis, Error Estimation, Model Validation Strategies, Predictive Performance Analysis.
Write a Python function to calculate the accuracy score of a model's predictions. The function should take in two 1D numpy arrays: y true, which contains the true labels, and y pred, which contains the predicted labels. It should return the accuracy score as a float.