Weighted Least Squares

easy
Unit 1 · Regression & Metrics0/3 to milestone

Some observations are more reliable than others. Weighted least squares minimises ∑iwi(yi−xi⊤β)2\sum_i w_i (y_i - x_i^\top\beta)^2.

Implement fit_wls(X, y, w) returning (intercept, coefs). Rows with weight 0 must be ignored entirely.

#regression#linear-algebra2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Weighted Least Squares · TechGradify