K fold cross validation python from scratch