High-Dimensional Asymptotics of Prediction: Ridge Regression and Classification