text_plain_output_1.png
from sklearn.linear_model import LinearRegression

from sklearn.linear_model import LinearRegression

from sklearn.model_selection import train_test_split

import pandas as pd

import seaborn as sns

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set
data = pd.read_csv('../input/boston-housing-dataset/HousingData.csv')

data = data.dropna()
data

X = data.drop('MEDV', axis=1).values
Y = data['MEDV'].values
X

Room_number = X[:, 5]
Room_number = Room_number.reshape(-1, 1)
Y = Y.reshape(-1, 1)

from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2, random_state=30)
regression_all = LinearRegression()
regression_all.fit(X_train, Y_train)
Y_prediction = regression_all.predict(X_test)
print('R^2: {}'.format(regression_all.score(X_test, Y_test)))