The theory behind overfitting, cross validation, regularization, bagging, and boosting: tutorial