• 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)
CRIM ZN INDUS CHAS NOX RM AGE DIS RAD TAX PTRATIO B LSTAT target
464 7.83932 0.0 18.10 0.0 0.655 6.209 65.4 2.9634 24.0 666.0 20.2 396.90 13.22 21.4
290 0.03502 80.0 4.95 0.0 0.411 6.861 27.9 5.1167 4.0 245.0 19.2 396.90 3.33 28.5
273 0.22188 20.0 6.96 1.0 0.464 7.691 51.8 4.3665 3.0 223.0 18.6 390.77 6.58 35.2
144 2.77974 0.0 19.58 0.0 0.871 4.903 97.8 1.3459 5.0 403.0 14.7 396.90 29.29 11.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. Required fields are marked *