Code Monkey home page Code Monkey logo

encode-categorical-features's Introduction

Encode-Categorical-Features

Handling Categorical/Qualitative variables is an important step in data preprocessing.Many Machine learning algorithms can not understand categorical variables by themself unless we convert them to numerical values. The performance of ML algorithms is based on how Categorical variables are encoded. The results produced by the model varies from different encoding techniques used.

Categorical variables can be divided into two categories:

  1. Nominal (No order)
  2. Ordinal (some order).

There are many ways we can encode these categorical variables

  1. One Hot Encoding
  2. Label Encoding
  3. Ordinal Encoding
  4. Frequency or Count Encoding
  5. Binary Encoding
  6. Base-N Encoding
  7. Helmert Encoding
  8. Mean Encoding or Target Encoding
  9. Weight of Evidence Encoding
  10. Sum Encoder (Deviation Encoding or Effect Encoding)
  11. Leave One Out Encoding
  12. CatBoost Encoding
  13. James-Stein Encoding
  14. M-estimator Encoding
  15. Hashing Encoding
  16. Backward Difference Encoding
  17. Polynomial Encoding
  18. MultiLabelBinarizer

Following libraries are used to perform encoding.

!pip install scikit-learn
!pip install category-encoders

Below cheat-sheet is a guiding tool to select enconding method.


References

  1. Category Encoders Documentation
  2. https://medium.com/swlh/an-introduction-to-categorical-feature-encoding-in-machine-learning-cd0ca08c8232
  3. https://towardsdatascience.com/benchmarking-categorical-encoders-9c322bd77ee8
  4. https://towardsdatascience.com/all-about-categorical-variable-encoding-305f3361fd02
  5. https://towardsdatascience.com/an-easier-way-to-encode-categorical-features-d840ff6b3900

encode-categorical-features's People

Contributors

sivasaiyadav8143 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.