I have data set comprising 24 rows of monthly data. The features are GDP, airport arrivals, month, and a few others. The dependent variable is number of visitors to a popular tourism destination. Would Random Forest be suitable for such a problem?

The data are non public so I am unable to post a sample.

  • 1
    $\begingroup$ Typically the one restriction on random forest is that your number of features should be quite big - the first step of RF is to choose 1/3n or sqrt(n) features to construct a tree (depending on task, regression/classification). So if you have quite a lot of features, use RF even on small dataset - there is no algorithm that works really good on small datasets so you loose nothing. $\endgroup$ Commented Jan 25, 2016 at 9:36
  • 2
    $\begingroup$ You're in the low range. RF will work, but probably will not learn much more complex stuff, than what you could realize from starring at the raw data. It helps, if your data is very low noise. From 40-50 samples it starts getting better. 500 good. 5000 awesome. $\endgroup$ Commented Jan 25, 2016 at 10:40
  • $\begingroup$ for regression the possible tree depth is limited by minnode=5, thus your samples would in average not get split more than 2 times [[ 24 ->(1) 12 ->(2) 6. ]] Including the mtry limitation, the model would have a hard time capturing any interaction effect or even simple non-linear effect. You could fiddle with minnode and mtry, but you should only do that if your data practically is noise less. Potential over fitted conclusions would be the flipside. You're obtained model structure would look like a roughly smoothed step-function. $\endgroup$ Commented Jan 25, 2016 at 10:48
  • $\begingroup$ stackoverflow.com/questions/24752941/… $\endgroup$
    – 404pio
    Commented Jan 26, 2016 at 21:08
  • $\begingroup$ For small dataset, use Cross Validation technique. For more information, stats.stackexchange.com/questions/19048/… $\endgroup$
    – Asif Khan
    Commented Jul 16, 2018 at 14:12

2 Answers 2


Random forest is basically bootstrap resampling and training decision trees on the samples, so the answer to your question needs to address those two.

Bootstrap resampling is not a cure for small samples. If you have just twenty four observations in your dataset, then each of the samples taken with replacement from this data would consist of not more than the twenty four distinct values. Shuffling the cases and not drawing some of them would not change much about your ability to learn anything new about the underlying distribution. So a small sample is a problem for bootstrap.

Decision trees are trained by splitting the data conditionally on the predictor variables, one variable at a time, to find such subsamples that have greatest discriminatory power. If you have only twenty four cases, then say that if you were lucky and all the splits were even in size, then with two splits you would end up with four groups of six cases, with tree splits, with eight groups of three. If you calculated conditional means on the samples (to predict continuous values in regression trees, or conditional probabilities in decision trees), you would base your conclusion only on those few cases! So the sub-samples that you would use to make the decisions would be even smaller than your original data.

With small samples it is usually wise to use simple methods. Moreover, you can catch up the small sample by using informative priors in Bayesian setting (if you have any reasonable out-of-data knowledge about the problem), so you could consider using some tailor-made Bayesian model.


On the one hand, this is a small data set, and random forest is data-hungry.

On the other hand, maybe something is better than nothing. There's nothing more to say than "Try it and see." You get to decide whether or not any particular model is "good;" moreover, we can't tell you whether any model is fit for a particular purpose (nor would you want us to -- there's no cost to us if we're wrong!).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.