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?

1 Like

Wiki: Lesson 1
(Prince Grover) #2

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

(Viggo Tellefsen Wivestad) #3

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?

1 Like

#4

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

0 Likes

(Mohanraj) #5

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

0 Likes