Hi Ethienne,
we (me and Gab) would like to thank you ! Finally we got what we were
looking for but we did it without use the "raster" packagebut we are
going to try also with it to see if it allow to have faster computation or
data manipulation,
If you're interested we can show you the code we
I usually use a rasterLayer object (from raster package) instead of a
SpatialGridDataFrame, but you probably just have to bind it to your data :
TL_training_2006_id.raw@data$prediction <- pred
This will create a band in which you have your predictions. raster package
doesn't handle the factors, so
Dear Ethienne, thanks a lot for your help.
We finally manage to perform the svm classification in this way:
library(spgrass6) ; G <- gmeta6()
TL_training_2006_id.raw<-readRAST6("TL_training_2006_id") # classes
training area
B1_B2_B3_train.raw<-readRAST6(c("AST_L1B_2008_05_2009_area_giusta_1_t
Look at ?predict.svm, you'll see that you need to provide a Matrix, not a
data.frame.
Etienne
--
View this message in context:
http://r.789695.n4.nabble.com/svm-with-GRASS-GIS-tp4388006p4403005.html
Sent from the R help mailing list archive at Nabble.com.
___
Dear Etienne, I'm a colleauge of Gabriele and I'm more into R (but he is
more into GRASS).
I'll try to explain you what we didi so far
1) Our ASTER images, (B1, B2 and B3) have 8363134 pixels; we made a subset
in order to have training data sets: that is, for each band (B1,B2 and B3)
916 pixels w
2012/2/15 gab
>
> Errore in scale(newdata[, object$scaled, drop = FALSE], center =
> object$x.scale$"scaled:center", :
> (subscript) indice logicol troppo lungo
>
I'm pretty sure the problem is with your data frame. Maybe if you share the
result of
dput(training[1:10, ])
# (make sure to include
Ciao Etienne, thank you.
Today I tried to understand something more. Here's what I did (The file
names are a bit different):
*training <- data.frame(cbind(TL_training_2006_id,
AST_L1B_2008_05_2009_area_giusta_1, AST_L1B_2008_05_2009_area_giusta_2,
AST_L1B_2008_05_2009_area_giusta_3N))*
Then ...
*x
Gab,
Make sure you have variables for each training.
training <- data.frame(Training_2006, AST_L1B_1, AST_L1B_2, AST_L1B_3N)
If you can't do that, then you don't have as many training observations
than you have predictive informations. Make sure to create a line for each
set of predictive pixels
Dear R Community-
I am a new user of R. I am using R with GRASS GIS.
I would apply svm "on" raster data in GRASS.
Basically I have a raster with "areas training" and other three raster (each
represents a band of ASTER satellite image).
My goal is to classify, according to training areas, the 3 ra
9 matches
Mail list logo