January 2020
Beginner to intermediate
372 pages
10h
English
In this recipe, we performed feature hashing using the Category Encoders package. We first loaded the dataset and divided it into train and test sets using train_test_split() from scikit-learn. Next, we set up HashingEncoder() to encode the A7 variable into four components. With the fit() method, HashingEncoder() created a mapping from the category to a set of binary vectors and with the transform() method, the encoder encoded the A7 variable in both the train and test sets.
Read now
Unlock full access