Welcome back.
Let's import the necessary libraries.
So here create a new cell and let's import our necessary libraries.
So this is the first section importing libraries.
Let's start with import TensorFlow as tf import pandas as pd, import numpy as np and import matplotlib.
Pyplot as plt.
For better data visualization, we're going to use a new library called Seaborn.
Seaborn is a Python data visualization library built on top of matplotlib library.
It provides a high level interface for creating attractive statistical graphics.
We're going to use like, uh, heatmaps and other complex and advanced graphics.
So for this we're going to use our lovely library called Seaborn.
Import Seaborn as SNES.
If you are using the IDE's Python IDE's, you should start with, for example pip install TensorFlow,
pip install seaborn, pip install matplotlib, pandas and numpy.
And if you are using like IDE's, PyCharm, Jupyter, you should execute those Python package commands.
Also, in order to check that they are already installed by Google Colab, you can run those commands,
adding the exclamation mark to execute the Python installer package from a cell.
So you notice that Google Colab requirement already satisfied.
So all of those libraries are found directly and without using the pip install with.
They are built in in the notebooks.
Okay, so there is no need to to install any of those libraries because they are already installed and
satisfied.
So post this.
Remove this cell and here we go.
Okay, so we imported this new library.
Seaborn, as I told you, it's used for data visualization.
It's built on built on top of Matplot library for advanced visualization.
We use Seaborn because it turns complex statistical relationships into beautiful, intuitive visualization
that helps students and professionals understand their data at a glance.
Also, we're going to use our old friend called scikit learn.
We talked about Sky scikit learn library in the previous sections and in the introductory sections with
data visualization and creating the models.
We're going in this model to use scikit learn with TensorFlow.
So TensorFlow is great for building and training neural networks, deep learning architectures, GPU
acceleration, production, deployment and sky kit.
Learn is great for data pre-processing and feature engineering, traditional machine learning algorithms,
model evaluation metrics, data splitting and cross-validation.
So we're going to use the scikit learn with with this model because we have nine parameters.
We need a simple API one line to split data.
Also, we're going to split the data between training and testing, flexible test size, random state
and and used in thousands of projects and perfect for TensorFlow returning numpy arrays.
So we use scikit learn for data pre-processing because preventing data leakage is critical for valid
results.
Simpler code industry standards, error resistance, and model agnostic same pre-processing works with
any ML library.
TensorFlow excels at what it's designed for building and training neural networks.
Let each library do what it does best.
Okay.
So we're going to use it with visualizing the standard metrics additional metrics and clear interpretations
from Sky.
Learn model selection import train test split Skyler metrics, import mean squared error, MSE mean
absolute error, and r squared score.
Also we're going to import our friend standard scatter.
And this is the main reason I used the sky layer.
So sky learn dot pre-processing import standard scalar.
Standard scalar is a data pre-processing tool that transforms your features to have a mean of zero and
standard deviation of one.
This is also called standardization or Z-score normalization.
And we're going to use the skyline pre-processing and import the Standardscaler from this package in
order to use it with our data.
The general formula of standardization, or Z-score is Z equals to x minus m over D, X is the original
feature value minus mean of the feature over the standard deviation of the feature.
Z is the scaled value Z-score.
Okay, so I want from you to understand this and why we're going to use the standard scaler in order
to transform your features, to have a mean of zero and standard deviation of one.
Okay.
Use standard scaler when features have different units and scales in.
In this example we have.
We have nine features and every feature has a different scale or unit, and using algorithms sensitive
to feature scales like neural networks, SVM, KNN, you assume features are roughly normally distributed.
So data is very important and the type of the data is very crucial in order to, uh, to determine what
algorithms, what libraries, what scalars you should use.
In this case, we're going to use the standard scalar that it is used that makes features compatible
by giving them same scale.
So we have nine different scales with nine different inputs, nine different variables and features.
We need to normalize them.
So standard scalar makes features compatible by giving the.