Assessing and Improving Prediction and Classification: Theory and Algorithms in C++