Effective Learning of Probabilistic Models for Clinical Predictions from Longitudinal Data