text_html_output_1.png
from sklearn import linear_model

import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train = pd.read_csv('/kaggle/input/random-linear-regression/train.csv')

test = pd.read_csv('/kaggle/input/random-linear-regression/test.csv')

(train.shape, test.shape)

train.sample(5)

train = train.dropna()

slr = linear_model.LinearRegression()

X_train = np.array(train.iloc[:, :-1].values)
y_train = np.array(train.iloc[:, 1].values)
X_test = np.array(test.iloc[:, :-1].values)
y_test = np.array(test.iloc[:, 1].values)

slr.fit(X_train, y_train)