Interview Query

Linear Regression Parameters

Start Timer

0:00:00

Upvote
4
Downvote
Save question
Mark as completed
View comments (6)
Next question

Given a matrix of X and y values, write a function to generate a transposed matrix and estimate the parameters for linear regression.

Example:

Input:

A = [[1, 5], [4,8], [5,9]]

Output:

#Output
linear_regression(A) -> [[[1, 4, 5], [5, 8, 9]]  , [4, 1]]

Note: Return the solutions a list of `[[A_T] , [coefficients]]

.
.
.
.
.


Comments

Loading comments