Fits a dense CoDA baseline: a centered log-ratio transform followed by a multilayer perceptron. The default backend uses torch when it is available, and otherwise falls back to `nnet::nnet()` or logistic regression for environments without torch.
Arguments
- X_train
Numeric training matrix with samples in rows and features in columns.
- y_train
Binary outcome vector.
- epochs
Number of training epochs. Defaults to `30`.
- lr
Learning rate. Defaults to `0.001`.
- batch_size
Mini-batch size. Defaults to `256`.
- class_weight
Logical; if `TRUE`, use inverse-frequency weighting.
- device
One of `"cpu"`, `"cuda"`, or `NULL`/`"auto"`.
- verbose
Logical; print training progress. Defaults to `TRUE`.
- seed
Integer random seed. Defaults to `42`.
- positive
Optional positive-class label for non-numeric outcomes.
- input_scale
Either `"log"` (default) or `"raw"`.
- backend
One of `"auto"`, `"torch"`, `"nnet"`, or `"glm"`.
Integer vector with the two hidden-layer sizes used by the torch backend. Defaults to `c(152, 136)`.
- dropout
Dropout rate used by the torch backend. Defaults to `0.3`.
References
Aitchison J. (1986). The Statistical Analysis of Compositional Data. Chapman and Hall.
Egozcue JJ, Pawlowsky-Glahn V, Mateu-Figueras G, Barcelo-Vidal C. (2003). Isometric logratio transformations for compositional data analysis. Mathematical Geology, 35(3), 279-300.
Gloor GB, Macklaim JM, Pawlowsky-Glahn V, Egozcue JJ. (2017). Microbiome datasets are compositional: and this is not optional. Frontiers in Microbiology, 8, 2224.
Quinn TP, Erb I, Richardson MF, Crowley TM. (2020). Understanding sequencing data as compositions: an outlook and review. Bioinformatics, 36(16), 4424-4432.