Learning and Optimization Methods for the Efficient Management of HVAC Systems