Adding multiple inputs to one column in tabular models


I’m trying to build a tabular model but I want to have more than one items under one category. For instance, I want to have a hobbies column and I want to add multiple things under that like cycling, soccer, hoola hoops etc. The items aren’t fixed in number. Is that possible? How can I do that?

Thanks in advance.

Did you find a way to make this work?

I think the best way wold be to use one hot encoding, not putting a different number of items in each column. The reason is, that when you use the first approach each entry is treated as string and categorized, where swimming could be category 1, cycling category 2 but swimming,cycling would be category 3 not 1 and 2.

So instead of:

soccer, cycling
swimming, fastai

You should do:

hobby_swimming hobby_cycling hobby_soccer hobby_fastai
0 1 0 0
0 1 1 0
1 0 0 1
1 0 0 0