I'm running into an error in the perf() function. I built the following model:
mod=spls(Y=Y[-test,], X=X[-test,], ncomp = 10, mode = c("regression", "canonical", "invariant", "classic"), keepX=which(colSums(X)>10), keepY=which(colSums(abs(Y))>10), scale = TRUE, tol = 1e-6,max.iter = 1000,near.zero.var = FALSE,logratio="none",multilevel=NULL,all.outputs = TRUE)
and get the following error
> perf(mod,'Mfold') |= | 1% Error in if ((crossprod(a.cv - a.old.cv) < tol) || (iter.cv == max.iter)) break : missing value where TRUE/FALSE needed In addition: Warning messages: 1: The SGCCA algorithm did not converge 2: The SGCCA algorithm did not converge 3: In cor(A[[k]], variates.A[[k]]) : the standard deviation is zero
Summaries of my X and Y (binary) matrixes:
It seems like an NA is sneeking in here through a.cv or a.old.cv and the crossprod calculations used to generate them. Any idea if this can be resolved?