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

(Arun Prakash) #1

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?

Wiki: Lesson 1
(Prince Grover) #2

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

Do ?? train_cats or apply_cats for more info

(Viggo Tellefsen Wivestad) #3

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


it returns

Object 'train_cats(df_raw)' not found.

Any suggestions?