Optimizing Energy Consumption: The Role of Data Analytics