Design of a reconfigurable metamaterial with the use of Bayesian optimization and machine learning