Edge-enhanced learning and analytics in distributed IoT systems