deoxysdefense forme gen rapidash gen swanna gen we can clearly see from the output feature set that all have been replaced by - in case of values which were previously all in the dummy coding scheme bin-counting scheme the encoding schemes discovered so far work quite well on categorical data in generalbut they start causing problems when the number of distinct categories in any feature becomes very large essential for any categorical feature of distinct labelsyou get separate features this can easily increase the size of the feature set causing problems like storage issuesmodel training problems with regard to timespace and memory besides thiswe also have to deal with what is popularly known as the curse of dimensionality where basically with an enormous number of features and not enough representative samplesmodel performance starts getting affected hence we need to look toward other categorical data feature engineering schemes for features having large number of possible categories (like ip addressesthe bin-counting scheme is useful for dealing with categorical variables with many categories in this schemeinstead of using the actual label values for encodingwe use probability based statistical information about the value and the actual target or response value which we aim to predict in our modeling efforts simple example would be based on past historical data for ip addresses and the ones which were used in ddos attackswe can build probability values for ddos attack being caused by any of the ip addresses using this informationwe can encode an input feature which depicts that if the same ip address comes in the futurewhat is the probability value of ddos attack being caused this scheme needs historical data as pre-requisite and is an elaborate one depicting this with complete example is out of scope of this but there are several resources online that you can refer to feature hashing scheme the feature hashing scheme is another useful feature engineering scheme for dealing with large scale categorical features in this schemea hash function is typically used with the number of encoded features pre-set (as vector of pre-defined lengthsuch that the hashed values of the features are used as indices in this pre-defined vector and values are updated accordingly since hash function maps large number of values into small finite set of valuesmultiple different values might create the same hash which is termed as collisions typicallya signed hash function is used so that the sign of the value obtained from the hash is used as the sign of the value which is stored in the final feature vector at the appropriate index this should ensure lesser collisions and lesser accumulation of error due to collisions hashing schemes work on stringsnumbers and other structures like vectors you can think of hashed outputs as finite set of bins such that when hash function is applied on the same valuesthey get assigned to the same bin out of the bins based on the hash value we can assign the value of hwhich becomes the final size of the encoded feature vector for each categorical feature we encode using the feature hashing scheme thus even if we have over distinct categories in feature and we set the output feature set will still have only features as compared to features if we used one hot encoding scheme let' look at the following code snippetwhich shows us the number of distinct genres we have in our video game dataset in [ ]unique_genres np unique(vg_df[['genre']]print("total game genres:"len(unique_genres)print(unique_genres