On statistical learning via the lens of compression