Whenever you're ready, walk me through how you'd approach this.
How would you implement a linear regression model from scratch?
Implement ordinary least squares without using a regression library. Define fit_linear_regression(X, y) for an input matrix X with shape (n, p) and target vector y with shape (n,), including an intercept, and return coefficients and predictions. Explain the matrix dimensions, coefficient calculation, model evaluation, and how you would handle singular or ill-conditioned matrices.