add selecting optimal number of iterations by cross-validation