[R-sig-Geo] rsaga multi.local.function

Chuck Bulmer cebulmer at telus.net
Fri Mar 2 07:23:46 CET 2012


Thanks for your reply Alex.

I am applying randomForest as a classification problem. 

and the outcome is a parent material class expressed as character (M,F,G,C
etc).

Here is the code I'm using for rf (reduced to 3 variables):

PGMRF<- randomForest(PGM_1 ~ ELEV+AACN+CNBL, data=PGM, importance=TRUE,
proximity=FALSE, TYPE=classification)


.. and the first lines of the data file PGM:
      PGM_1      ELEV      AACN      CNBL
1         M 1433.43 164.87 1268.56 


.. and the first line of output from the predict method   
PGMpred <- predict(PGMRF, PGM)
print (PGMpred)
1     2     3     4     5     6     7     8     9    10    11    12    13 
 M     M     M     M     M     M     M     M     M     M     M     M     M 

So it seems the rf prediction is working.. (?)
All I need to do now (I think) is to predict for each cell in the area based
on the values in a set of grids, then assign the results to a grid.

I'm new to this so undoubtedly have made some mistakes,,, 

Could you possibly suggest an alternative method if I've got it wrong??

ps I have tried again on a separate computer and get the same results as in
my original post, so it seems that 'sometimes', multi.local.function is able
to convert the characters to numeric and write them to the grid, but not
always.. Multi.focal.function seems to do that 'conversion' more reliably..
Curious!

Thanks again

Chuck



--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/rsaga-multi-local-function-tp7319490p7335569.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list