Creating custom pytorch dataset class for n number of target columns

I have a tabular dataset , where I have to perform multi-label classfication . For that , I am unable to figure out how to write its custom dataset class for 100 target columns

e.g. if its like 5 - 10 target classes I can write like this -->

from torch.utils.data import Dataset
import torch

class for_5_target_columns(Dataset):
    def __init__(self, tabular_data , is_valid):
        self.tabular_data = tabular_data
        self.1st_target_value = tabular_data.1st_target_value.values
        self.2nd_target_value = tabular_data.2nd_target_value.values
        self.3rd_target_value = tabular_data.3rd_target_value.values
        self.4th_target_value= tabular_data.4th_target_value.values
        self.5th_target_value = tabular_data.5th_target_value.values
        
    def __len__(self):
        return len(self.tabular_data)
    
    def __getitem__(self, index):
        tabular_data = self.tabular_data.iloc[:,:]
        
        X = tabular_data[training_input.columns()] #training_input.columns() represents column names of X_train
        X = X.values[index]
       
        return {
            'tabular_data' : torch.tensor(X, dtype = torch.float) , 
            '1st_target_value' : torch.tensor(self.1st_target_value[index], dtype = torch.float), 
            '2nd_target_value' : torch.tensor(self.2nd_target_value[index], dtype = torch.float), 
            '3rd_target_value' : torch.tensor(self.3rd_target_value[index], dtype = torch.float),  
            '4th_target_value' : torch.tensor(self.4th_target_value[index], dtype = torch.float),  
            '5th_target_value' : torch.tensor(self.5th_target_value[index], dtype = torch.float)
        }

How to achieve the same for 100 target columns having different column names ?

this thread has been not categorized yet , @admins plz hel me to categorize it , so that It can reach out to required people which will eventually help me in getting solution asap.

Which category would you like to use for this topic?

Last few days I was googling about this issue which I created here , finally this post helped me in resolving my problem . Thanks :blush: