Uncertainty-Aware Probabilistic Machine Learning for Prediction and Design Optimization in Energy Systems