Majority Baseline and Error Reduction
~10 mincode completion
Implement baseline_report(train_labels, test_labels, test_preds) returning the array [baseline_acc, model_acc, error_reduction]. Labels are non-negative integers, and the baseline always makes at least one test error.
Where this shows up
~10 min
••••••••••••••••
8 employers weight this skill
3 AI product companies, 2 frontier labs, 1 health and bio company, 1 big tech firm, 1 autonomy company. Top match scores 93.
Python
import numpy as np
def baseline_report(train_labels, test_labels, test_preds):
"""
Score a model against the majority-class baseline.
Args:
train_labels: integer labels the model was trained on, shape (n_train,)
test_labels: true test labels, shape (n_test,)
test_preds: model predictions on the test set, shape (n_test,)
Returns:
array [baseline_acc, model_acc, error_reduction]
"""
# YOUR CODE HERE
pass