WIP for PP-140: Add nfolds to deep learning and grid search for all algorithms. Fix a bug that was causing slice failures.