A bandit-learning approach to multifidelity approximation