Training and testing the random forest