FrugalML switches between APIs to improve image classification and cut costs