I am working on a categorical dataset I need to undersample 3 variables based on a type _Box. Every categorical variable has many modalities. How can I have the same number of samples for each categorical variables per box_type?
I have tried to apply undersample first under one variable than try with train_test split to undersample each modality for the second variable with stratifying the first variable but I don't get the same number the rate changes. is there any suggestion thank you?