Get number items in each class from dataloaders object?

I’m working through the chapter 2 production notebook. After grabbing my own dataset and creating a dataloaders object, I would like to do some exploratory data analysis. Specifically, I want to visualize a potential class imbalance, by getting the number of observations in each class and plotting them. Of course there are many ways to do this, but I figured the Dataloaders class must of some convenient method for getting this information?

Apologies if this a stupid question, I’m sure someone must have asked this on the forums before but my searching skills are failing me and I cannot find my answer in the docs.

Thanks in advance!

1 Like