NumPy allowed · plain Python earns 10 bonus points
Re-weight training samples based on classifier correctness in an AdaBoost boosting round.
Implement adaboost_weight_update(sample_weights, y_true, predictions, alpha): compute unnormalized weight w_i * exp(-alpha * y_i * h_i) where y_i, h_i in {-1, 1}. Normalize weights so their sum equals 1.0. Round each float to 4 decimal places.
adaboost_weight_update(sample_weights: list[float], y_true: list[int], predictions: list[int], alpha: float) -> list[float]