Closed Dishant-garg closed 7 months ago
@Dishant-garg can you explain your approach!
Uses the normal equation to calculate coefficients: X.T.dot(X): Calculates the Gram matrix (X^T * X). np.linalg.inv(X.T.dot(X)): Inverts the Gram matrix. (X.T.dot(X)).dot(X.T).dot(y): Multiplies matrices to obtain coefficients. Uses matrix multiplication to predict target values: X.dot(np.hstack((self.intercept, self.coef))). It can work for small data sets but yaa it will give problem with large datasets due to matrix inversion
@darshbaxi pls tell if this is not asked by question
solved issue #10 i have get the better accuracy from my previous linear regression model done with libraries new r2_score: previous r2_score: @darshbaxi pls review the pr