# For random forest, what's the difference between out-of-bag error and k-fold cross validation?

I am trying to forecast a time series using random forest. In order to validate my model, I came cross two tests: OOB and K-fold cross validation. My question is:

1. For a time series, is out-of-bag error a out of sample test, does it make sense to test the accuracy "backward" using the historical data when I am trying to find the prediction accuracy?

2. What is the difference between holding the last few points of the data and do a out of sample test vs a OOB?

• I think on ts or any other ordered data you can only have structured cv, i.e. take the first $n-k$ observations for training, the remaining $k$ for cross-validation – Alex Sep 27 '16 at 14:52
• @Alex Agree. I read a few documents and people are referring out-of-bag "Prediction accuracy" indicator which confused me. Maybe OOB doesn't apply to time series after all ... – butterbetter Sep 28 '16 at 14:30
• just use cross-validation error. In sklearn package you can use GridSearchCV class for this – Alex Sep 28 '16 at 14:53