Hi All,

I fitted several classifiers in a two class problem. I then used the package 
'yaImpute' - to apply my predictive models to asciigrids and thereby generate a
probability maps. So far I successfully used yaImpute to generate maps for
Random Forests, Classification trees, Generalized Linear Models (GLMs) and
Generalized Additive Models (GAMs). But when I try to use it to two other 
classifiers
- support vector machine (SVM) and linear discriminant analysis (LDA) - I am
getting an error message which I am not really sure what it is trying to tell
me. Can you please take few minutes of your time to help me understand what
these error messages are?

I used the following piece of code to apply my models to grids once I fit the 
model for both LDA and SVM: 

AsciiGridPredict(lda.fit,xfiles=namelist,outfiles = as.character(outfile))
AsciiGridPredict(svm.fit,xfiles=namelist,outfiles = as.character(outfile))

I am getting the following error message for LDA: 

Rows per dot:  1  Rows to do: 163 
ToDo:
...................................................................................................................................................................
Done: .
First six lines of predicted data for map row:  2 
  predict.class predict.posterior.0 predict.posterior.1 predict.LD1
1         
<NA>              
-9999              
-9999       -9999
2         
<NA>              
-9999              
-9999       -9999
3         
<NA>              
-9999              
-9999       -9999
4         
<NA>              
-9999              
-9999       -9999
5         
<NA>              
-9999              
-9999       -9999
6         
<NA>              
-9999              
-9999       -9999
Error in AsciiGridImpute(object, xfiles, outfiles, xtypes = xtypes, lon =
lon,  : 
  predict is not present in the predicted data
In addition: Warning message:
In `[<-.factor`(`*tmp*`, ri, value = c(-9999, -9999, -9999, -9999,  :
  invalid factor level, NAs generated

I am getting the following error message for SVM:

Rows per dot:  1  Rows to do: 163 
ToDo:
...................................................................................................................................................................
Done:
...................................................................................................................................................................
Legend of levels in output grids:
  predict
1       0
2       1
There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In `[<-.factor`(`*tmp*`, ri, value = c(-9999, -9999, -9999,  ... :
  invalid factor level, NAs generated
2: In `[<-.factor`(`*tmp*`, ri, value = c(-9999, -9999, -9999,  ... :
  invalid factor level, NAs generated
3: In `[<-.factor`(`*tmp*`, ri, value = c(-9999, -9999, -9999,  ... :
  invalid factor level, NAs generated
4: In `[<-.factor`(`*tmp*`, ri, value = c(-9999, -9999, -9999,  ... :
  invalid factor level, NAs generated
5: In `[<-.factor`(`*tmp*`, ri, value = c(-9999, -9999, -9999,  ... :
  invalid factor level, NAs generated

I hope my writing is clear and my questions make sense.



      
        [[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