Cost-aware learning of relevant contextual variables within Bayesian optimization