The Credit Card example

Here we use the the credit card data. The data are from an extensive database from Taiwan and include more than ten predictors.

For categorical data -Scikit-Learn- provides a so-called one-hot encoder. This is called one-hot encoding, because only one attribute will be equal to 1 (hot), while the others will be 0 (cold). Scikit-Learn provides a OneHotEncoder encoder to convert integer categorical values into one-hot

from sklearn.preprocessing import OneHotEncoder
encoder = OneHotEncoder()