These are borrowed from Kaggle Forums, but come in handy
a small function used for cv in scripts