TabularPandas Categorify question

Thank you in advance for answering my noob question.

I’m working on the Titanic Kaggle competition.

How do I get fastai to assign the same Categorical values to the training set and test set?
The train and test(for final prediction) data are in separate files.

If I create 2 different TabularPandas objects(one for train and one for test), the categorical mapping is not consistent (the int for the Title of Dr. might be 7 in the train set, but 5 in the test set).

If you check out the integrations section of the docs you’ll find an example that applies to a test set (look for to.new())

1 Like

Thanks! That’s exactly what I was looking for.