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 corresponding to a training pixel. That should
then work in svm().

Once you have a satisfying model, take the rest of your pixels (where you
have no training) and make a prediction using the model.

Hope this helps,
Etienne

2012/2/14 gab <gis...@libero.it>

> 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 raster.
> Trying to replicate the guides found on the net, I did the following:
> # load raster
> Training<-readRAST6("Training")
> AST_L1B_1<-readRAST6("AST_L1B_1")
> AST_L1B_2<-readRAST6("AST_L1B_2")
> AST_L1B_3N<-readRAST6("AST_L1B_3N")
> #and then
>  model_ASTER <-
> svm(Training_2006,AST_L1B_1,AST_L1B_2,AST_L1B_3N,type='C',kernel='linear')
> #but
> Errore in data.frame(y, x) :
>  arguments imply differing number of rows: 1857076, 1488
>
> Thanks for any help
>
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/svm-with-GRASS-GIS-tp4388006p4388006.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to