Member-only story

3 Ways To Deal With Missing Values in Machine Learning Using Python

Boost your model’s performance by eliminating missing data

Pralabh Saxena
3 min readApr 8, 2021
Hand reaching for the horizon
Photo by Alexander Lam on Unsplash.

Data cleaning is a crucial process of machine learning modelling. The accuracy of a machine learning algorithm can be reduced due to missing values in our data. Therefore, it is necessary to clean the data before training the machine learning model.

There are various techniques in Python to deal with missing data. Using those techniques, we can remove missing values from our data and then use that data for further machine learning or data analysis processes.

This article will cover how we can deal with missing values using different techniques in Python. Let’s get started!

1. fillna()

This fillna() function is available in the pandas package. This function is used to fill null (NA/NaN) values present in the data/dataset using the specified method. You can also “forwardfill” or “backfill” your rows with other values from the data.

It returns an object as output in which null/missing values are filled.

Syntax: Series.fillna(value=None, method=None, axis=None, inplace=False, **kwargs)

--

--

Pralabh Saxena
Pralabh Saxena

Written by Pralabh Saxena

Data Engineer | Data Science | Love to write and express. About me https://linktr.ee/pralabhsaxena

No responses yet