Naive Bayes classifiers for compositional data using the alpha-transformation | R Documentation |

Naive Bayes classifiers for compositional data using the *α*-transformation.

alfa.nb(xnew, x, ina, a, type = "gaussian")

`xnew` |
A matrix with the new compositional predictor data whose class you want to predict. Zeros are allowed. |

`x` |
A matrix with the available compositional predictor data. Zeros are allowed. |

`ina` |
A vector of data. The response variable, which is categorical (factor is acceptable). |

`a` |
This can be a vector of values or a single number. |

`type` |
The type of naive Bayes, "gaussian", "cauchy" or "laplace". |

The *α*-transformation is applied to the compositional and a naive Bayes classifier is employed.

A matrix with the estimated groups. One column for each value of *α*.

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

Friedman J., Hastie T. and Tibshirani R. (2017). The elements of statistical learning. New York: Springer.

```
comp.nb, alfa.rda, alfa.knn, comp.knn, mix.compnorm
```

x <- Compositional::rdiri(100, runif(5) ) ina <- rbinom(100, 1, 0.5) + 1 mod <- alfa.nb(x, x, a = c(0, 0.1, 0.2), ina )

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.