Energy-efficient adaptive machine learning on IoT end-nodes with class-dependent confidence