About this question

Ridge Regression Closed Form

Easy · machine_learning · Quant Researcher interview question · machine-learning, regression, regularisation, linear-algebra, numpy

Ridge regression adds an L2 penalty to ordinary least squares, yielding a numerically stable closed-form solution even for ill-conditioned design matrices. In quantitative finance, it is commonly used to fit factor models or signal weights across highly correlated predictors, preventing the coefficient explosion seen in OLS. The solution involves solving a system of linear equations that incorporates the regularization parameter alpha. Task Implement the function solution(X: listlistfloat, y: l