New machine-learning method cuts energy use by 20%