Training using random forest