egr95 / R-codacore

An R package for learning log-ratio biomarkers from high-throughput sequencing data.
Other
21 stars 3 forks source link

Add zero check for predict.codacore method #3

Closed tpq closed 3 years ago

tpq commented 3 years ago

I like the check for 0s on the codacore function. I just ran into an unexpected outcome when deploying the codacore on a data set that had zeros, resulting in NaN and Inf yhat values. Perhaps we should add a check for zeros in the `predict.codacore' method?

tpq commented 3 years ago

Similarly, it is possible for summed log-ratio prediction to produce strange output. Is epsilon added during model deployment?

egr95 commented 3 years ago

I have added the zeros check in the predict function. As for the SLR prediction, indeed, epsilon is added during deployment, but I'm now feeling more inclined to just removing support for zero-laden data in the SLR altogether, to avoid such 'strange' or unpredictable behavior...

egr95 commented 3 years ago

I'm leaving warnings in the SLR case for now.