Foundations of statistical learning and model selection