Description Usage Arguments Value Slots Author(s) References Examples
SpNaBaScore is used to store Score's parameters of the Naive Bayes model.
1 | SpNaBaScore(Apriori, Scx, ...)
|
Apriori |
numeric |
Scx |
numeric |
... |
argument pass to other methods. |
An object of class SpNaBaScore
. See slot section for more details.
Apriori
vector
with S rows. Each element represents
the apriori probability log(P(C)/P(C'). See
score
.
Scx
matrix
with M rows and S columns. Each element
represents the Score function S(X). See
score
.
Enrique Del Callejo Canal (edelcallejoc@gmail.com), based on implemented algortihms in web platform SPECIES (see References).
http://species.conabio.gob.mx/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Using SpNaBaMatrix constructor ----------------------
a <- matrix(rbinom(100, 100, runif(100, 0, 0.1)), nrow = 10, ncol = 10,
dimnames = list(paste0("id:", 1:10), letters[1:10]))
x.mat <- SpNaBaMatrix(freqmatrix = a)
# Counts calculation ----------------------------------
x.counts <- counts(x.mat, target = 1:3)
# Probability calculation -----------------------------
x.probs <- probs(x.counts)
# Estimating epsilon ----------------------------------
x.score <- score(x.probs)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.