You are viewing a single comment's thread. Return to all comments →
from sklearn import linear_model from numpy import multiply as mult m,n = map(int, input().split()) lst_features, lst_y = [], [] for _ in range(n): *features, y = map(float, input().split()) lst_features.append(features) lst_y.append(y) lm = linear_model.LinearRegression() lm.fit(lst_features, lst_y) a = lm.intercept_ b = lm.coef_ for _ in range(int(input())): feature_set = list(map(float, input().split())) mult_sum = sum(mult(b, feature_set)) print(round(a + mult_sum, 2))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 9: Multiple Linear Regression
You are viewing a single comment's thread. Return to all comments →