Learning Joint Models of Prediction and Optimization