### 6 Must learn Data Pre-Processing Algorithms in Machine Learning and Artificial Intelligence ( With Google Colab Notebooks)

Share this post

#### Categorical Data

In this post, we are discussing data preprocessing techniques used in Machine Learning and Deep Learning along with code development in python.

### Table of Contents

- What is data pre-processing?
- Why we need data pre-processing in Machine Learning and Artificial Intelligence?
- Data Preprocessing Techniques based Data Type
- Impact of Data Pre-processing on Accuracy of Model
- Google Colab Notebook and Github Codes

### What is Data Pre-processing?

Data Pre-Processing is an important and necessary step in any Machine Learning and Deep Learning project. It is all about removing unwanted information and modifying data to extract insights from data. Data Preprocessing is about the following operations to be performed on data before going to build a Machine Learning and Deep Learning Algorithms.

- Handling Missing missing Values in Dataset
- Standardizing Data ( A statistical Approach)
- Data Reduction
- Data Integration
- Data Scaling

### Why we need data pre-processing?

We can't imagine a machine learning project without a data preprocessing step. According to techjury, 2.5 quintillion bytes( 1 million terabytes) data is generated every day by humans in the world. Most of the data is unstructured and raw. Machine Learning algorithms unable to much from data with that raw or un-preprocessed data.

Image Courtesy of Unsplash

### Data Pre-processing Techniques in Machine Learning

In Machine Learning, mostly there will be three data types. They are

- Numerical
- Categorical
- Mixed data ( Categorical + Numerical)

Types of Numerical data pre-processing techniques

- Data Standardization
- Data Normalization
- Binarizing data
- Handling Improper values in data
- Robust Scaling

Types of Categorical data Pre-processing

- Label Encoding
- One Hot Encoder

#### Requirements for Code

- Sample Dataset Download
- Google Colab Notebook
- Sklearn Library
- Python Programming Language

#### Data Standardization in python using sklearn

Data Standardization is a statistical approach widely used in most of Machine Learning and Deep Learning Project to preprocess.

Output = (Input - Variance) / Standard Deviation

Data Standardization technique in python

#### Data Normalization

Data Normalization is a technique that compresses data between (0,1) or (-1, 1). Data Normalization algorithm follows

Output = (Input - Minimum Value) / Maximum - Minimum

Data Normalization Technique in Python

#### Binarizing Data

The Whole data values are replaced with either o or 1 based on the threshold value. For Example if the threshold value set as 0.3, then values less than 0.3 are replaced as 0 and are greater than 0.3 are replaced as 1.

Binarizing data technique in python

#### Handling Missing Values

In some datasets, there maybe have to get null values. we have to either remove or replace that null value with any other possible value. If we remove entire row, there may be a chance to lose important information. So we have to replace that null value with any other possible one.

Replacing Null values with mean of the column

#### Categorical Data

Categorical data means it contains text but it has much information to learn in some cases. There will be again two sub-types

- Binary Labels
- Multi-Class Labels

#### Categorical Data Pre-Processing ( Binary Labels)

In Binary Label encoding one variable is labeled as 1 and the other is with 0. Python Implementation of Binay Lable Encoding.

#### Categorical Data Pre-Processing ( Multi-Class Labels)

In Multi- Lable Encoding all variables are labeled starting from index 0 to the size of the column.

#### Robust Scaling Technique

Robust scaling technique is about removing outliers of data for better Normalization and Standardization. After Robust Scaling, if we apply Normalization or Standardization gives the best results.

Python Implementation of Robust Scaling

### Impact of Preprocessing on Machine Learning Algorithm

Features of Data preprocessing

- With Data Preprocessing, we can extract more information from data.
- To clean data like replacing missing values
- To Improve Performance of Model
- For Data Reduction

### Source Codes for this Topic

Google Colab Notebook can be accessed by clicking here.

Github Code is available at githubcode

Comment below if you have queries about code and everything

Thank you for your time!! ðŸ¤©ðŸ¤©

Preprocessing
Neural Python
Machine Learning
Deep Learning
Sklearn
Normalization

## Comments

## Post a Comment