Implemented choosing best regularization constant via cross-validation