Learning under random distributional shifts