IMPORTANCE OF DATA CLEANING AND DIFFERENT WAYS TO CLEAN DATA IN MACHINE LEARNING
Welcome to our blog on “IMPORTANCE OF DATA CLEANING AND DIFFERENT WAYS TO CLEAN DATA IN MACHINE LEARNING”.
In this blog, we are explaining to you what is Data Cleaning in Machine Learning, its importance and different ways to clean data in Machine Learning.

Data cleaning plays an important role in the field of Data Management and Machine learning. It is a fundamental aspect of the Machine learning. The performance and getting the accurate results from the whole data depends upon the Data cleaning.
Data Cleaning: Data cleaning is the process of preparing data which is used for analysis by filtering or removing out unwanted data which is incorrectly formatted, duplicated or corrupted data present within the dataset.

NOTE: It can also be represented as Garbage In and Garbage Out.
IMPORTANCE OF DATA CLEANING
a) Data cleaning is the Fundamental and Key element of the Basic Data Science.
b) It improves the standard and quality of the training data for analytics and allows to make accurate decisions.
c) It increases the efficiency of data by removing unwanted data.
d) Data Cleaning reduces error in the dataset and increases the accuracy if dataset.
e) Data cleaning is the key to a properly functioning data analytics solution.
DIFFERENT WAYS TO CLEAN DATA IN MACHINE LEARNING:
These are the 5 different ways to clean our data which is next used for analysis for getting better results.
1. Removing duplicates from the Data:
In the Data Cleaning we have to remove the duplicated data from the dataset. A data is said to be a duplicated if it is continuously repeated itself in a dataset, with it having more than one occurrence. This usually arises due to combining data from two or more sources.

Observation:
By removing the duplicated data or reiterated data items the standard of the data set will be increased.
2. Handling the Missing Data:
We shall not ignore the missing values or missing data in the dataset. It will create a huge impact on the performance of the dataset.

Observation:
At first we have to drop data that have missing values so, that we have to lose some data after that we have input some missing values based on other observation in the data.
3. Removal of Irrelevant data:
Presence of Irrelevant data in the dataset will reduces the accuracy and quality of dataset. For example, when we are analysing the scores of Students we need not have to know the Native places of those Students. Then, we will remove the places column from the dataset.

Observation:
So, by using the necessary syntaxes we will remove the irrelevant data in the dataset which will not be useful for any analysis of the data.
4. Handling the Outliers in the Data:
There will be some observations in the data which do not appear to fit within the data at the time of analysing the data. So, removal of these outliers will enhance the performance of the dataset. If an observation is found to be out of the range of the given dataset then we use the Inter Quantile Range Technique to filter those outliers. Hence we divide outliers into two categories Q3 and Q1 where Q3 is called 75th Quantile of Data and Q1is called 25th Quantile of Data.
Formula for ‘‘INTER QUANTILE RANGE DETECTION (IQR)’’:

We have to calculate the outliers in the data using this formula.

Observation:
Outliers gives the more insight into the model of the data. They may change the way the data performs in an unexpected manner. So, we have to be more careful when removing the outliers from the data.
5. Convert Unstructured Data to Structured Data:
In the given dataset we have to check whether the given dataset is in the Structured form or not. If the Dataset set is not in the form of Numerical data then, we have to convert it into numerical form. Machine Learning Algorithms can only work with the ‘Numerical Data’.
So, we have to convert categorical data into Numerical data by using Encoding process
Encoding is of Two types:
a) Label Encoding
b) One-Hot- Encoding
a) Label Encoding for Binary Categorical Data
Example: Here Gender is present in the given dataset and we have to convert into Binary categorical Data by encoding it.

Here we have categorized the Gender into Binary categorical data by using ‘0’ and ‘1’.
b) One - Hot - Encoding for Multi Class categorical data:
Example : Here Horse, Cow and goat are three animals present in the given dataset and we have to convert into Multi class categorical Data by encoding it.

Here we have categorized the Animals using binary digits according to their presence in each row by using binary numbers ‘0’ and ‘1’.
Observation:
Encoding is very essential in the Data Cleaning as it converts Textual data into binary according to their classifications in the given dataset.
CONCLUSION:
Data cleaning is an important step in the success of any machine learning function because it can have a significant impact on the performance and quality of a model. About 80% of effort is spent on the data cleaning process. Data cleaning involves identifying, correcting and removing errors and reducing the inconsistency in the dataset.
So, friends we have seen Data Cleaning importance and different methods of Data Cleaning in Machine Learning. Now, you exactly know what is data cleaning , its importance and its structure in Machine Learning.
I hope that you all had learnt something new in this blog and I feel it is useful to all you at some point of time in your Data Science career.
All the Best and Please, don’t forget to share your thoughts and opinions in the comment session.