figure - feature set depicting one hot encoded features for pokemon generation and legendary status from the result feature set depicted in figure - we can clearly see the new one hot encoded features for gen_label and lgnd_label each of these one hot encoded features is binary in nature and if they contain the value it means that feature is active for the corresponding observation for examplerow indicates the pokemon dialga is gen pokemon having gen_label (mapping starts from and the corresponding one hot encoded feature gen has the value and the remaining one hot encoded features are similarlyits legendary status is truecorresponding lgnd_label is and the one hot encoded feature legendary_true is also indicating it is active suppose we used this data in training and building model but now we have some new pokemon data for which we need to engineer the same features before we want to run it by our trained model we can use the transformfunction for our labelencoder and onehotencoder objectswhich we have previously constructed to engineer the features from the training data the following code shows us two dummy data points pertaining to new pokemon in [ ]new_poke_df pd dataframe([['pikazoom''gen 'true]['charmytoast''gen 'false]]columns=['name''generation''legendary']new_poke_df out[ ]name generation legendary pikazoom gen true charmytoast gen false we will follow the same process as before of first converting the text categories into numeric representations using our previously built labelencoder objectsas depicted in the following code in [ ]new_gen_labels gen_le transform(new_poke_df['generation']new_poke_df['gen_label'new_gen_labels new_leg_labels leg_le transform(new_poke_df['legendary']new_poke_df['lgnd_label'new_leg_labels new_poke_df[['name''generation''gen_label''legendary''lgnd_label']out[ ]name generation gen_label legendary lgnd_label pikazoom gen true charmytoast gen false we can now use our previously built labelencoder objects and perform one hot encoding on these new data observations using the following code see figure -