reg = LinearRegression()
4.Use the test set to predict the output after training.
# Load the data
Follow the below steps to accomplish your task:
1.Load the datasets individually.
2. They should be in the same format of rows and columns .
3.Use the train set to fit the model.
train = pd.read_csv('train.csv')
test = pd.read_csv('test.csv')
# Fit (train) model
reg.fit(X_train, y_train)
# Predict
pred = reg.predict(X_test)
# Score
accuracy = reg.socre(X_test, y_test)
If you wish to learn about Python visit this Python Course.