How to ensure optimal online learning?