Hi mixOmics Team,
I am trying to run the perf function for an sPLS analysis result:
> result.spls <- spls(X, Y, ncomp = 5, mode = "regression")
> perf.pls <- perf(result.spls, validation = 'Mfold', folds = 7, nrepeat = 50, progressBar = TRUE, cpus = 1)
But whenever I run the perf function I am getting the following error message:
> perf.pls <- perf(result.spls, validation = 'Mfold', folds = 7, nrepeat = 50, progressBar = TRUE, cpus = 1)
[======== ] 16%Error in X.test %*% a.cv : non-conformable arguments
> perf.pls <- perf(result.spls, validation = 'Mfold', folds = 7, nrepeat = 50, progressBar = TRUE, cpus = 1)
[= ] 2%Error in X.test %*% a.cv : non-conformable arguments
> perf.pls <- perf(result.spls, validation = 'Mfold', folds = 7, nrepeat = 50, progressBar = TRUE, cpus = 1)
[== ] 4%Error in X.test %*% a.cv : non-conformable arguments
As you can see in the output the error does not always occur at the same point/time. I already tried it with a decreased nrepeat parameter and if I run it over and over again with the lower nrepeat value it can happen that in about 1of 5 times the function finishes without an error.
> perf.pls <- perf(result.spls, validation = 'Mfold', folds = 7, nrepeat = 5, progressBar = TRUE, cpus = 1)
[============================== ] 60%Error in X.test %*% a.cv : non-conformable arguments
> perf.pls <- perf(result.spls, validation = 'Mfold', folds = 7, nrepeat = 5, progressBar = TRUE, cpus = 1)
[==================== ] 40%Error in X.test %*% a.cv : non-conformable arguments
> perf.pls <- perf(result.spls, validation = 'Mfold', folds = 7, nrepeat = 5, progressBar = TRUE, cpus = 1)
[============================== ] 60%Error in X.test %*% a.cv : non-conformable arguments
> perf.pls <- perf(result.spls, validation = 'Mfold', folds = 7, nrepeat = 5, progressBar = TRUE, cpus = 1)
[==================================================] 100%
The same problem appears when using tune.spls. I assumed that it is a problem with the input data, but the dimensions are ok and there are no NZV values in the input matrices.
> dim(X)
[1] 16 30
> dim(Y)
[1] 16 23
> nearZeroVar(X)
$Position
integer(0)
$Metrics
[1] freqRatio percentUnique
<0 rows> (or 0-length row.names)
> nearZeroVar(Y)
$Position
integer(0)
$Metrics
[1] freqRatio percentUnique
<0 rows> (or 0-length row.names)
Additionally, when I use the same two datasets for the DIABLO block.splsda analysis perf and tune.block.splsda are working without a problem.
Please could you help me with this problem?
Thank you very much in advance for your help!