Fast AI Library: How to get the same category codes for test data from train data codes?

I understand that we call proc_df function for converting all the categorical data to integer codes. Let’s say we code “Apple” as 1 in the training data by using proc_df function.

Now, I want to transform the test data, the same way as training data (Apple = 1). How to do this by using this library?

1 Like

To convert category to numeric, use train_cats and apply_cats (fast.ai library)

Do ?? train_cats or apply_cats for more info

3 Likes

When following along the ml1-course, I am able to run the code. However, if I try to write

??train_cats

it returns

Object 'train_cats(df_raw)' not found.

Any suggestions?

2 Likes

I also came across this same error. Did you find any solution ?

Even im encountering same issue in kaggle kernel. Please assist me.