What is the error you get ? And shouldn’t __len__ return the value like this…
def __len__(self):
    "Denotes the total number of samples"
    # subtract 1 from the file len to skip header in getitem
     return self._total_data - 1