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

Plot Error #19

Open
Glfrey opened this issue Mar 22, 2023 · 1 comment
Open

Plot Error #19

Glfrey opened this issue Mar 22, 2023 · 1 comment

Comments

@Glfrey
Copy link

Glfrey commented Mar 22, 2023

Hello,

I'm getting the following error when trying to plot my own data (doesn't occur with tutorial data):

> plot(model)
Error in stats::model.frame.default(formula = logRatio ~ y) : 
  variable lengths differ (found for 'y')

Model fitting seemed to go well with 5 log ratios found. Any idea what's up?

@egr95
Copy link
Owner

egr95 commented Mar 27, 2023

This may be a symptom of #20, where your data are perfectly separable and as a result your "optimal" model is able to push the log-ratio scores of the two classes to +infinity and -infinity, respectively. Is this the example you mentioned with 20 data points? If so, what is the dimensionality (the number of input variables that form your log-ratios)? What does the model output look like when you call print? As an idea of what could be happening, suppose there is a simple log-ratio log(A/B) such that your datapoint is positive whenever log(A/B) > 0 and negative whenever log(A/B) < 0. Then the "optimal" predictive model would be log-odds(y) = slope * log(A/B), with slope = infinity. Such a model can be used to make predictions, however plotting slope * log(A/B) wouldn't make sense.

I'd also be happy to help debug your particular example and check if there's something else going on here if you are able/willing to share the data.

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.
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