Posted by Mohit Sharma | Last Updated: 14-Jan-19
It is one of the most fundamental and important parts, even it is one of the most time-consuming parts of machine learning.Since without properly formatted data it can't be used. The data that we usually get is raw which cann't be used directly to train the model.We need to preprocess the data so the model accurately predicts the output.The real world data are generally noisy i.e. contains errors and outliers, inconsistent and incomplete.Because of these reasons, data preprocessing is an important part of machine learning.Types of data preprocessing:1. Data cleaning2. Data Reduction.Data Cleaning1. Fill the missing valuesa. Ignore the tuple.b. Use the mean to fill the missing the value.c. Predict the missing values using various learning algorithms.2. Smooth out noisy data (using binning).Example:Bin1: 3,6, 15Bin2: 19,20, 24Bin3: 29,34, 42
Smoothing by bin means:Bin1: 8,8,8Bin2: 21,21,21Bin3: 35,35,35Smoothing by bin boundaries:Bin1:3,3,15Bin2:19,19,24Bin3:29,29,423. Outliers removal methods
Clustering b. Curvefittingc. Hypothesis-testing is given the model.In Python, We can use the Pandas library for any kind of manipulation of the data.Data Reduction
Sometimes data we get is more than required to we need to apply different techniques to reduce its size.1. Reducing the number of attributes.a. Data cube aggregation: applying roll-up, slice, dice operations.b. Removing irrelevant attributes.2. Reducing the number of attribute valuesa. Clustering group values in clusters.b. Aggregation or generalization.3. Reducing the number of tuples.a. Sampling.
Once, we collect data with concise attributes, then it'll be ready to be used in a machine learning model directly.
Now you can see performance, accuracy and generalization of a machine learning model is highly depend on the kind of input data, as we discussed intially data preprocessing in a very important and should not be overlooked with trying to make a machine learning program.