Machine Learning, Data Science, Python, Statistics, Evaluation Metric.
where the consequences of false positives and false negatives need careful consideration. from sklearn.metrics import f1_score # Calculate F1 score f1 = f1_score(y_true, y_pred) print("F1 Score:", f1) Use Case: In a sentiment analysis model, F1 score ensures that your model not only correctly