stratified segment-grouped k-fold cross-validation

I have a music numerical data (2282 rows × 173 columns) to predict the target sad, happy, angry, relaxed. Now one of the attribute is segment_id and I want to group the data according to segment_id and apply stratified CV. How can I do it? I have 26 segments and each segment appear at least 50 times or more in the data set. I have no idea where to start? Could someone give me some hints? If you need further info, I would be more than happy to provide more info. Thanks!

Topic data cross-validation

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.