# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Boston house price prediction using Multiple Linear Regression
#
# In this notebook, I'll be using the Boston house-prices dataset. 
# The dataset consists of 13 features of 506 houses and the median home value in $1000's. 
# I'll fit a model on the 13 features to predict the value of the houses.

# Import libraries and data set
from sklearn.linear_model import LinearRegression
from sklearn.datasets import load_boston

# Loading data from bosyon house price dataset
boston_data = load_boston()
x = boston_data['data']
y = boston_data['target']

# Creating a regression model using scikit-learn's LinearRegression
model = LinearRegression()
model.fit(x,y)

# +
# Make a prediction using the model
sample_house = [[2.29690000e-01, 0.00000000e+00, 1.05900000e+01, 0.00000000e+00, 4.89000000e-01,
                6.32600000e+00, 5.25000000e+01, 4.35490000e+00, 4.00000000e+00, 2.77000000e+02,
                1.86000000e+01, 3.94870000e+02, 1.09700000e+01]]

# Predicting housing price for the sample_house
prediction = model.predict(sample_house)
print(prediction)

StarcoderdataJupyterScriptsDedupFiltered