<jupyter_start><jupyter_text>Multiple Linear RegressionWe just saw how we can predict life expectancy using BMI. Here, BMI was the predictor, also known as an independent variable. A predictor is a variable we're looking at in order to make predictions about other variables, while the values we are trying to predict are known as dependent variables. In this case, life expectancy was the dependent variable.If the outcome we want to predict depends on more than one variable, we can make a more complicated model. As long as they're relevant to the situation, using more independent/predictor variables can help we get a better prediction.When there's just one predictor, the linear regression model is a line, but as we add more predictor variables, we're adding more dimensions.When we have one predictor variable, the equation of the line is***y=mx+b***and the plot might look something like we saw before.Adding a predictor variable to go to two predictor variables means that the predicting equation is:$ y=m_1x_1 +m_2x_2 + b $To represent this graphically, we'll need a three-dimensional plot, with the linear regression model represented as a plane. Data discoverWe'll be using the [Boston house-prices dataset](https://archive.ics.uci.edu/ml/datasets/Housing). The dataset consists of 13 features of 506 houses and their median value in $1000's. We'll fit a model on the 13 features to predict on the value of houses. Load the libraries<jupyter_code>from sklearn.linear_model import LinearRegression
# here we just downloaded the data from the library
from sklearn.datasets import load_boston<jupyter_output><empty_output><jupyter_text>Load the data<jupyter_code># Load the data from the the boston house-prices dataset 
boston_data = load_boston()
x = boston_data['data']
y = boston_data['target']<jupyter_output><empty_output><jupyter_text>Linear Regression<jupyter_code># Make and fit the linear regression model
# Fit the model and Assign it to the model variable
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]]<jupyter_output><empty_output><jupyter_text>Prediction<jupyter_code># Predict housing price for the sample_house
prediction = model.predict(sample_house)
print(prediction)<jupyter_output>[ 23.68420569]
{'fraction_non_alphanumeric': 0.07000795544948289, 'fraction_numerical': 0.06682577565632458, 'mean_word_length': 5.448717948717949, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 3, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '564630', 'license': 'MIT', 'n_tokens_mistral': 856, 'n_tokens_neox': 703, 'n_words': 303, 'path': '01.neural_network/03.multiple_linear_regression/multiple_linear_regression.ipynb', 'repo_name': 'hadibakalim/derinOgrenme', 'size': '2514'}