sunduanchen / Scissor

Scissor package
GNU General Public License v3.0
168 stars 29 forks source link

Error in reliability.test #34

Open loganylchen opened 2 years ago

loganylchen commented 2 years ago

Hi there,

When I ran the reliability.test in my own data, I encountered an error as below:

Error in roc.default(Y_test, score_test, direction = "<", quiet = T): 'response' must have two levels
Traceback:

1. reliability.test(X, Y, network, alpha = 0.05, family = "binomial", 
 .     cell_num = numbers, n = 10, nfold = 10)
2. test_logit(X, Y, network, alpha, cell_num, n, nfold)
3. roc(Y_test, score_test, direction = "<", quiet = T)
4. roc.default(Y_test, score_test, direction = "<", quiet = T)
5. stop("'response' must have two levels")

May I ask your help for resolving the issue?

Thanks, Logan

460350 commented 11 months ago

I had the same problem with my own data, too. I was wondering if you managed to solve this or not.

RoseString commented 9 months ago

Probably a sample size issue, and some of the folds may contain samples from only one level, thus failing the two-level requirement of roc().