Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROC error #21

Closed
Glfrey opened this issue Mar 30, 2023 · 2 comments
Closed

ROC error #21

Glfrey opened this issue Mar 30, 2023 · 2 comments

Comments

@Glfrey
Copy link

Glfrey commented Mar 30, 2023

Hello again @egr95,

I'm still playing around with CoDaCoRe and I've come across a new error when using a smaller subset of my data (dimensions=12, 71), with 8 positive and 4 negative instances when fitting a model and the objective="binary classification":

Error in roc.default(cdbl$y[foldIdx == j], yHat, quiet = TRUE) : 
  'response' must have two levels

Model fitting performs without warning or errors when objective=regression.

@egr95
Copy link
Owner

egr95 commented Mar 31, 2023

This again looks like a small sample-size problem. In the "discretization" step of the algorithm (see Section 3.3 of the paper), we are computing the ROC curve over different folds of the training data, which in this case will have such few datapoints there is not always representation from both positive and negative instances (both classes need to be represented in order to compute an ROC curve). You could try reducing the number of folds (something like codacore(x, y, cvParams=list(numFolds=3))), but such a model is probably not to be trusted anyway.

I will push some kind of error or warning to clarify the source of this error. Thank you for flagging.

egr95 added a commit that referenced this issue Mar 31, 2023
This should provide more clarity to the user in situations such as #19 #20 #21.
@Glfrey
Copy link
Author

Glfrey commented Mar 31, 2023

Hi @egr95 ,

Thank you as always, that makes sense.

@Glfrey Glfrey closed this as completed Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants