Thanks a lot for you answer, I will definitely take what you said into considiration.
Here is my CustomLoader2 class, i did that to easily manipulate my dataset :
class CustomLoader2(Dataset):
    def __init__(self, chemin):#The path to the file
        xy = pd.read_csv(chemin)
        xy.loc[xy['species']=='Iris-setosa', 'species']=0
        xy.loc[xy['species']=='Iris-versicolor', 'species']=1
        xy.loc[xy['species']=='Iris-virginica', 'species']=2
        x = xy.iloc[:, 0:-1]
        y = xy.iloc[:, -1]
        self.len = x.shape[0]
        self.x_data = torch.tensor(x.values)
        self.y_data = torch.tensor(y.values)

    def __getitem__(self, index):
        return self.x_data[index], self.y_data[index]
    
    def __len__(self):
        return self.len