I assume scaling is done for normalization. If so, you should split your data first and then scale it. Otherwise you will leak the test information into your training procedure.


Have a look at the Data loading tutorial 21. Basically you create a Dataset and add your data augmentation in the __getitem__ function. The DataLoader can use multi-processing to speed up the loading and transformations.


It really depends on the data. Since you only remove 8 out of 9k, it seems not to be that bad. Alternatively, try to fill the NaNs with the mean or median of the feature from your training set.


You can use the weight argument for different loss functions (see here 1). Alternatively, you can over- or undersample your classes using WeightedRandomSampler 4. I’ve created a small tutorial 8 on this topic, which is not released yet, but might give you a good start.