malucalle/selbal

error: Response and predictor must be vectors of the same length

Opened this issue · 1 comments

Hello,

I am interested to try selbal on my dataset. However, when I run selbal.cv() using only y on one dichotomous variable, I have the following error at step 1:
task 1 failed - "Response and predictor must be vectors of the same length."

My command is:

xRaw <- mifilterraw_selbal_MonoNeg[,1:821]
print(dim(xRaw))
yRaw <- as.factor(mifilterraw_selbal_MonoNeg[,822]) #metadata selected TypeResult
print(length(yRaw))
length(yRaw) == nrow(xRaw)

mifilterraw.selbal_MonoNeg <- selbal::selbal.cv(x = xRaw, y = yRaw, n.fold = 5, n.iter = 10,
                                                logit.acc = "AUC", zero.rep = "bayes")

I have checked my x reads counts matrix and y variable vector, and they have the same size (length(y) == nrow(x)). I have many warning of column with too many zeros/unobserved value, could it explain the issue?

I thank you in advance for the help.

Regards

Nicolas

Hi!

It seems to be an issue with roc function (line 1943 at Selbal_Functions.R), here you have a post where they talk about the message that appears to you.

It is difficult to know what is going on with your data because it may generate "NA" for the predictions (as explained in the post).

What can you do?

First, I would try again the code ignoring those rows whose values are mainly zeros and check if that works.
Then, come back and tell us if that worked for you.

Let`s see if setp by step we can solve your problem!