Boston Dataset

  • Boston Dataset is a part of sklearn library. 
  • Sklearn comes loaded with datasets to practice machine learning techniques and boston is one of them. 
  • Boston has 13 numerical features and a numerical target variable. 
  • Boston dataset can be used for regression.
  • Let’s learn to load and explore the famous dataset.  

Code to load and view Boston Dataset

# Imports 
from sklearn.datasets import load_boston
import pandas as pd

# Load Data
boston = load_boston()

# Create a dataframe
df = pd.DataFrame(boston.data, columns = boston.feature_names)
df['target'] = boston.target
X = boston.data
df.sample(4)
CRIMZNINDUSCHASNOXRMAGEDISRADTAXPTRATIOBLSTATtarget
4647.839320.018.100.00.6556.20965.42.963424.0666.020.2396.9013.2221.4
2900.0350280.04.950.00.4116.86127.95.11674.0245.019.2396.903.3328.5
2730.2218820.06.961.00.4647.69151.84.36653.0223.018.6390.776.5835.2
1442.779740.019.580.00.8714.90397.81.34595.0403.014.7396.9029.2911.8

That's how we learned about Boston Dataset

That’s all for this mini tutorial. To sum it up, we learned how to Build Logistic Regression classifier.

Hope it was easy, cool and simple to follow. Now it’s on you.

Leave a Reply

Your email address will not be published.