I have a 5.8 m resolution satellite image (LISS IV by IRS-P6, in bands 4, 3 and 2) of a densely forested region in the Eastern Himalayas (altitude 700 m to 3200 m). My objective is to predict regions of canopy cover. Regions of canopy vs. non-canopy.

The R model 'randomForest' turns out to be a popular and a do-able method; now to understand how it works more thoroughly.

In the question Performing Random-Forest Classification of 10cm Imagery for species-distribution in R (no point-shapes)? the example training data has an ndvi and a class column.

Will the inclusion of terrain and NDVI datasets (elevation, aspect, slope) improve the predictive ability of the algorithm?

  • 2
    Could you please pare this down to a single answerable question? Remember, you can always ask multiple questions as separate posts.
    – Aaron
    Commented May 28, 2015 at 20:13

1 Answer 1


In the example you are referencing, NDVI is included as a predictor variable along with all of the band values. The response variable is the class (vegetation type). In your case, you could simply have a binary response (cover, or non-cover).

Random forests is a very valuable machine learning algorithm because you can incorporate any type of predictor you can imagine, including both continuous and discrete datasets. The distribution of the data does not effect the model performance.

For your type of land cover classification, it would be advisable to include predictor variables such as slope, aspect, elevation, CTI, texture, and a variety of vegetation indices. You can also include landform data such as soil type, horizontal distance to water, vertical distance to water, etc...

There is an interesting competition at Kaggle that highlights how to classify forest cover using only landform variables--I highly recommend reading through the forums, since there are lots of sample scripts and links to literature on the subject. Here is the link:

Forest Cover Type Prediction

  • Thanks A, that was very useful! This question may be noobish but: how can I predict a model into classes of varying canopy density (say 4 categories)? I am not sure what point training data I would have to use.
    – csheth
    Commented May 28, 2015 at 20:47
  • 1
    @Aaron, it is not very good practice to use a symbolic syntax for randomForest models in R. The way the model is parsed to the Fortran code notably slows down the model. It is best to pass the vector/matrix objects directly. Commented May 28, 2015 at 20:48
  • 2
    @Chintan Sheth, your training data would need to reflect the classes your are interested in. So, if you have continuous measurements of canopy density you would need to find thresholds representing your 4 categories. Commented May 28, 2015 at 20:51
  • 1
    @Aaron, why do you assert that a binary model would yield high accuracy? You are basically intimating that binomial processes will always produce a good RF model, which is certainly not the case. Commented May 28, 2015 at 20:53
  • 1
    @Aaron, I received the same PCC. This results effectively represent a gradient function in the data that is not present in the crisp boundaries. There are many instances of multiple membership (p>0.65) where the highest probability obviously represents the competing class. Not to equivocate here, but the reason that I developed this method in the first place was to account for competition in niche models. What would be interesting is to predict the probabilities to the training data and then use them in a single all class model thus, accounting for niche competition. Commented May 29, 2015 at 14:10

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