0

I tried to train a model in RDotNet and got this error:

Error in train.default(x, y, weights = w, ...) : Stopping

I ran the same script in RStudio and it added some more information:

Something is wrong; all the ROC metric values are missing:

     ROC           Sens          Spec    
 Min.   : NA   Min.   : NA   Min.   : NA  
 1st Qu.: NA   1st Qu.: NA   1st Qu.: NA  
 Median : NA   Median : NA   Median : NA  
 Mean   :NaN   Mean   :NaN   Mean   :NaN  
 3rd Qu.: NA   3rd Qu.: NA   3rd Qu.: NA  
 Max.   : NA   Max.   : NA   Max.   : NA  
 NA's   :6     NA's   :6     NA's   :6

Does anyone where/how I can pull that information from the REngine when the exception above appears since it doesn't appear to be in the exception itself? Thanks.

user353gre3
  • 2,747
  • 4
  • 24
  • 27
ds_practicioner
  • 733
  • 8
  • 20
  • I have had experience with this and it is helpful lesson that many classification algorithms expect variables in `factor` class i.e. if you have numeric`classes=c(0,1)` , they need to be transformed to first as character , `classes=c("0","1")` OR `classes=c("zero","one")` and finally , `classes=as.factor(classes)`. In short, target variable needs to be of class `factor` and unfortunately I could not locate this in documentation. See this for [similar question](http://stackoverflow.com/questions/32551859/something-is-wrong-all-the-roc-metric-values-are-missing) – Silence Dogood Oct 20 '16 at 00:05
  • Thanks, I hadn't gotten that far yet :). Unfortunately, that same error could come from multiple sources so I was hoping to have a way to figure out how to differentiate between them. I figure if RStudio can do it, maybe I can too. Regards. – ds_practicioner Oct 21 '16 at 16:15

1 Answers1

0

Ran across this while researching. It's not a perfect solution, but this post should do the trick. Using the withCallingHandlers function you can at least capture errors and warnings and review them later.

How do I save warnings and errors as output from a function?

Community
  • 1
  • 1
ds_practicioner
  • 733
  • 8
  • 20