On-demand tunable metamaterials design for noise attenuation with machine learning