Principles of Learning in Multitask Settings: A Probabilistic Perspective