deepsignal r run time error

Posted By: hola123

deepsignal r run time error - 03/22/20 21:49

Hi,

I am trying to follow one of the machine learning lessons. I have copied the code and downloaded R.

When I run the TestOOS function I get the error message below. The code runs and says deep nn has been trained. Then it bugs out with the error message shown below. Has anyone else come across this problem? The data I'm using was created by zorro.


Error: `data` and `reference` should be factors with the same levels.
4.
stop("`data` and `reference` should be factors with the same levels.",
call. = FALSE)
3.
confusionMatrix.default(Y.pr, Y.ob)
2.
confusionMatrix(Y.pr, Y.ob) at DeepSignal.r#49
1.
TestOOS()

Thanks for any help
Posted By: Smon

Re: deepsignal r run time error - 04/03/20 10:23

I don't know, but here is a trick I often use when I'm debugging something in R:

put this line on top of the R script:

Code
debugpath <- paste0("D:/Zorro/Strategy/RWDLexample.rda")
//the *.rda file is a complete memory snapshot. Put it anywhere you like.

Code
neural.train <- function(model, XY) {
  save.image(debugpath)
  #load(debugpath)
  ....


(just add these two lines)
Beware: every neural.train function call will save a complete memory snapshot

Now when I'm debugging, I first clear the R session in RStudio, then source the R file and then execute

load(debugpath)

Then I can check line by line what's happening.
Posted By: hola123

Re: deepsignal r run time error - 04/04/20 18:17

Thanks for the tip, will give this ago and see what happens
© 2024 lite-C Forums