Git Product home page Git Product logo

rafeyiqbalrahman / data-imputation-techniques Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 9 KB

This repository demonstrates data imputation using Scikit-Learn's SimpleImputer, KNNImputer, and IterativeImputer.

License: MIT License

Python 100.00%
imputation imputation-methods scikit-learn scikitlearn-machine-learning scikit-learn-python datapreparation preprocessing sklearn sklearn-library

data-imputation-techniques's Introduction

Data Imputation Techniques

Data imputation refers to the technique of filling up missing values in the dataset. Missing values are quite common in real-world datasets. Training your model with missing values results in inaccurate predictions. This is why data imputation techniques are a must-know for anyone in the field of ML, DL, or Data Science.

In this repository, three (03) such techniques known to me so far have been applied, namely Simple Imputation, KNN (k-Nearest Neighbor) Imputation, and Iterative Imputation. All of these techniques have been applied through the popular Scikit-Learn machine learning library.

SimpleImputer

As the name implies, it is one of the simplest imputation techniques. SimpleImputer works for both numeric and string data. Although, there are further 4 techniques in SimpleImputer to impute data, statistical techniques, like filling the missing values with the mean and median of the non-missing data are among the most common. However, they both are limited to numeric data. I can call SimpleImputer a fixed imputation technique since it will return the same values for the same data. For further info, refer to the respective API reference guide page here: https://scikit-learn.org/stable/modules/generated/sklearn.impute.SimpleImputer.html

KNNImputer

As opposed to SimpleImputer, KNNImputer is not a fixed imputation technique. Rather, the resulting data depends on the number of neighbors you specify. Here, the term 'neighbors' refers to the non-missing values near the missing data. For instance, if I specify 2 neighbors, I shouldn't expect to get the same results when I specify the number of neighbors to be 5. For further info, refer to the respective API reference guide page here: https://scikit-learn.org/stable/modules/generated/sklearn.impute.KNNImputer.html

IterativeImputer

This technique is experimental so you can expect to be getting different set of values. The API Reference Guide page suggests that IterativeImputer imputes the data in a 'round-robin' fashion. The API Reference Guide Page can be found here: https://scikit-learn.org/stable/modules/generated/sklearn.impute.IterativeImputer.html

Missing Values Representation in the Dataset

The dataset used in the code contains missing or null values marked with a question mark '?'.

data-imputation-techniques's People

Contributors

rafeyiqbalrahman avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.