Locked lesson.
About this lesson
We need to install some more elements to do a linear regression, so we'll discuss what we need in this video.
Exercise files
Download this lesson’s related exercise files.
Linear Regression Installation.docx59.2 KB Linear Regression Installation - Solution.docx
57.4 KB
Quick reference
Linear Regression Installation
To run Linear Regression analysis, we need to install a number of things.
When to use
You only need to do this once. After it's all installed, you can use it whenever you like.
Instructions
From the Terminal:
- pip install scikit-learn
- pip install matplotlib
- pip install seaborn
- pip install matplotlib
From your Jupyter Notebook, import everything:
- import numpy as np
- import pandas as pd
- %matplotlib inline
- import scipy.stats as stats
- import matplotlib.pyplot as plt
- import sklearn
- from sklearn.datasets import load_boston
- import seaborn as sns
- boston = load_boston()
Finally, create a DataFrame with the Boston Data:
bost = pd.DataFrame(boston.data, columns=boston.feature_names)
Hints & tips
- First Install all the programs we need on the Terminal
- Next import all the modules into your Jupyter Notebook
- Load The Boston Data, then create a DataFrame with it
Lesson notes are only available for subscribers.