Explain the least squares method
Company: Sunrise
Role: Software Engineer
Category: Machine Learning
Difficulty: easy
Interview Round: Onsite
Explain the **least squares** method:
- What optimization problem does ordinary least squares (OLS) solve?
- Derive the closed-form solution for linear regression in matrix form.
- What assumptions are typically made (noise model, full rank, independence)?
- How do numerical stability and regularization (e.g., ridge regression) change the solution/implementation?
Quick Answer: This question evaluates understanding of the ordinary least squares method, covering linear regression as an optimization problem, matrix-algebra derivations, probabilistic noise and independence assumptions, and numerical regularization techniques.