Learning and Optimizing Probabilistic Models for Planning under Uncertainty