Dear Researchers,

I wish to ask a suggestion to classify a raster stack using predict () of
raster and Random Forest. Sorry if I am not an expert in this area, and is
the first time I am trying to use random forest with raster library.

I am classifying Radar and Landsat images using a large number of ground
truth point data. In the first step I created a raster stack of all our
images (band.full.stack),
and I selected the pixels where I have the ground truths and assigned
values for each class in the training data. From this I created a matrix
(variable.m) and I ran the
model:

myModel.rf <- randomForest(variable.m, GRID_CODE.f, ntree=800, mtry=6,
replace=FALSE, nodesize=1, importance=TRUE, keep.forest=TRUE)

where GRID_CODE.f is the assigned class values for the training data.

I used the model to classify all bands using the following:

r.rfpredict <- predict(band.full.stack, myModel.rf, type="response",
overwrite=TRUE, progress='text')

Please, I have some questions:

1-  The band.full.stack consists of 11 raster images, yet when I run the
model if I set mtry = 11 it gives an error. I wish to know why I can't set
it to use all bands?

2-  I am trying to determine a confusion matrix, but I am unsure which
method/function is the most appropriate? I found this function rfcv(),
however I am unsure if it is the best way to obtain a confusion matrix.

3- In the examples I reviewed, I noticed they all used set.seed () before
running the model, I was just wondering if this is necessary in my case?



thanks in advance for any help
Gianni

	[[alternative HTML version deleted]]

