Closed Steviey closed 2 years ago
Please provide simple reproducible example. I cannot do anything unless I can reproduce it. There can be many reasons why that error appeared, pointing to the specific line doesn't help.
Update: I will provide a native-test with that result in mind- as soon as possible. It's not tidymodels. I can only reproduce it with live-data. Very strange effect. More of, what does this has to do with colnames from above? Could be an indicator of multiple causes.
idx=120
y <-rnorm(idx, mean=15, sd=5)
x1 <-rnorm(idx, mean=15, sd=5)
x2 <-rnorm(idx, mean=15, sd=5)
x3 <-seq(0,1,0.1)
x3 <-rep(x3,idx)
data <- data.frame(n2=x1,week=x2,n2Norm=x3,value=y,stringsAsFactors=F)
data <- data %>% dplyr::relocate(value)
dataLength <-nrow(data)
#-------------orig. live-data (same type, probably other distribution)
data1 <- as.data.frame(allData)
data1 <- tail(data1,n=120)
#-------------orig. live-data (same type, probably other distribution)
colVect <- c('value','n2','week','n2Norm')
data <- data %>% dplyr::select(any_of(colVect))
data <- tail(data,n=120)
data[['n2Norm']]<-data1[['n2Norm']]
data[['week']]<-data1[['week']]
#data[['n2']]<-data1[['n2']] <-model will not be fitted if uncommented
data[['value']]<-data1[['value']]
myModel <- adam(data,"ANN",silent=TRUE,h=1,holdout=FALSE)
Ideas:
tidymodels, not native
I know I have seen this error a couple of times. But I can't remember how I fixed it.... It seems to have something to do with line 780 in...
https://github.com/config-i1/smooth/blob/master/R/adam.R
How can I check the length of the components?
Someone remember?
https://stackoverflow.com/questions/12985653/what-does-length-of-dimnames-1-not-equal-to-array-extent-mean
Noticed 1: The error disappears, if I modify the threshold for correlating predictors....
step_corr(all_numeric(), -all_outcomes()"), threshold = 0.10)
... This reduces the amount of predictors via correlation measurements.This leads me to the assumption, that this is related to input-data. So propably no real bug. I can't provide live-data. And simulating will not guarantee a reproduce able example in this case. :-)
Just for interest...
Noticed 2: The parameters to reproduce 'the effect' with individual data were:
[1] "ANN" [1] "likelihood" [1] "ds" corr-threshold = 0.5 the test consist of 21 predictors all data was numeric and median-imputed
... I will try to drill it down, to a specific predictor....
Result: The effect is reproduce-able with a normalized data-column called: "n2Norm" (predictor).
Rename it to 'myNormalizedVar' will let the code run through (strange but true :-)).