[EDIT] It turns out that I accidentally made TrainDataSet a function, instead of a class. This simple fix resolved the issue. My apologies
I have recently learned how to create a custom DataSet class. The class and its init method are shown below:
def TrainDataSet(Dataset):
    def __init__(self, data, labels=None, transforms=None):
        self.data = data.values()
        self.labels = labels.values()
        self.transforms = transforms

However, when I try to define a TrainDataSet as below:
dataset = TrainDataSet(data, labels, transform)

I get the following error:
TypeError: TrainDataSet() takes 1 positional argument but 3 were given

Could someone please help me with this?
The full stack trace is below
Traceback (most recent call last):
  File "/Users/~/PythonProjects/MLProject/preprocess.py", line 39, in <module>
    dataset = TrainDataSet(data, labels, transform)
TypeError: TrainDataSet() takes 1 positional argument but 3 were given