You are viewing a single comment's thread. Return to all comments →
from sklearn import linear_model X = [] y = [] shape = list(map(int, input().split())) new_X = [] for _ in range(shape[1]): parts = list(map(float, input().split())) X.append(parts[:shape[0]]) y.append(parts[-1]) for _ in range(int(input())): new_X.append(list(map(float, input().split()))) lm = linear_model.LinearRegression() lm.fit(X, y) y_hat = lm.predict(new_X) for y in y_hat: print(f'{y:.2f}')
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 →