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

Reverse engineer balance #22

Open
johannesbjork opened this issue Aug 2, 2023 · 1 comment
Open

Reverse engineer balance #22

johannesbjork opened this issue Aug 2, 2023 · 1 comment

Comments

@johannesbjork
Copy link

Hi Elliott,

Would it be possible to use CoDaCoRe to "reverse engineer" a balance? With that I mean, say you already have candidate species which you want to test. Can you plug these species in and use CoDaCoRe machinery to test their predictive ability? It may be fat fetched and perhaps easier to do in a different way.

Thanks,
Johannes

@egr95
Copy link
Owner

egr95 commented Aug 5, 2023

Hi Johannes,

I can think of 3 different ways to interpret your question, here are my thoughts for each:

  • You have defined a candidate log-ratio ahead of time and want to test it's predictive power. This case is simple: you can just compute the log-ratio, call it x, and then fit a (logistic) regression y~x where y is your (binary) outcome of interest. No codacore needed :)
  • You have a candidate subset of species known ahead of time, and want to find a predictive log-ratio that is constructed from this subset, but you don't know a priori which species should go into the numerator or denominator. This case is also simple: you can create a reduced dataset where you select the candidate species only (i.e., discard all other species), and pass the reduced dataset to codacore.
  • You have some particular species that a priori you would like to include in a predictive log-ratio, but you don't know what other species it should be combined with. In other words, how to find a predictive log-ratio, such that species A is included? This is trickier, but I think codacore could be adapted for such cases, though it would require fiddling with the internals. The idea is to change the optimization code to use an initialization that is not completely "neutral" but rather one that favors the selection of species A. Sort of like giving the algorithm a strong prior to select species A. If you wanted to try implementing this, my suggestion would be to edit this line, by changing initializer_zeros() to something like keras_array(custom_initialization) where the you can try passing a vector of zeros, but with a positive value in place of the position of species A.

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