- 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.
Related Resources:
- Pipeline in scikit learn | Machine Learning Tutorial Pipeline in scikit learn Pipeline in scikit learn simplifies whole machine learning model building and testing flow. Machine learning model...
- Digits Dataset | Scikit learn datasets Digits Dataset Digits Dataset is a part of sklearn library. Sklearn comes loaded with datasets to practice machine learning techniques...
- Iris Dataset – A Detailed Tutorial Iris Dataset Iris Dataset is a part of sklearn library. Sklearn comes loaded with datasets to practice machine learning techniques...
- Build Logistic Regression classifier model in Python Build Logistic Regression classifier Logistic regression is a linear classifier. Despite the name it is actually a classification algorithm. #...
- Bag of words model | NLP | scikit learn tokenizer Bag of words model Bag of words (bow) model is a way to preprocess text data for building machine learning...
- Build Decision Tree classification model in Python Build Decision Tree classifier Build Decision tree model. It is a machine learning algorithm which creates a tree on the...
- Building Adaboost classifier model in Python Building Adaboost classifier model Adaboost is a boosting algorithm which combines weak learners into a strong classifier. Let’s learn building...
- Build K Nearest Neighbors classifier model in Python Build K Nearest Neighbors classifier K Nearest Neighbors also known as KNN takes max vote of nearest neighbors and predicts...
- Build Random Forest classification model in Python Build Random Forest classifier Random forest is an ensemble technique which combines weak learners to build a strong classifier. #...
- Build SVM Support Vector Machine model in Python Build SVM | support vector machine classifier SVM (Support Vector Machine) algorithm finds the hyperplane which is at max distance...