total game genres ['action'adventure'fighting'misc'platform'puzzle'racing'role-playing'shooter'simulation'sports'strategy'we can clearly see from the output that there are distinct genres and if we used one hot encoding scheme on the genre featurewe would end up having binary features insteadwe will now use feature hashing scheme by leveraging scikit-learn' featurehasher classwhich uses signed -bit version of the murmurhash hash function the following code shows us how to use the feature hashing scheme where we will pre-set the feature vector size to be ( features instead of in [ ]from sklearn feature_extraction import featurehasher fh featurehasher(n_features= input_type='string'hashed_features fh fit_transform(vg_df['genre']hashed_features hashed_features toarray(pd concat([vg_df[['name''genre']]pd dataframe(hashed_features)]axis= iloc[ : out[ ]name genre super mario bros platform - mario kart wii racing - - wii sports resort sports - - pokemon red/pokemon blue role-playing - - tetris puzzle - - new super mario bros platform - thus we can clearly see from the result feature set that the genre categorical feature has been encoded using the hashing scheme into features instead of we can also see that rows and denote the same genre of gamesplatform which have been rightly encoded into the same feature vector as expected feature engineering on text data dealing with structured data attributes like numeric or categorical variables are usually not as challenging as unstructured attributes like text and images in case of unstructured data like text documentsthe first challenge is dealing with the unpredictable nature of the syntaxformatand content of the documentswhich make it challenge to extract useful information for building models the second challenge is transforming these textual representations into numeric representations that can be understood by machine learning algorithms there exist various feature engineering techniques employed by data scientists daily to extract numeric feature vectors from unstructured text in this sectionwe discuss several of these techniques before we get startedyou should remember that there are two aspects to execute feature engineering on text data pre-processing and normalizing text feature extraction and engineering without text pre-processing and normalizationthe feature engineering techniques will not work at their core efficiency hence it is of paramount importance to pre-process textual documents you can load feature_engineering_text py directly and start running the examples or use the jupyter notebookfeature engineering on text data ipynbfor more interactive experience let' load the following necessary dependencies before we start