SpNaBaEps-class: Class SpNaBaEps

Description Usage Arguments Value Slots Author(s) References Examples

Description

SpNaBaEps is used to store Epsilon's parameters of the Naive Bayes model.

Usage

1
SpNaBaEps(Ecx, ...)

Arguments

Ecx

numeric matrix. See slot section for more details.

...

argument pass to other methods.

Value

An object of class SpNaBaEps. See slot section for more details.

Slots

Ecx

matrix with S rows and M columns. Each element represents the epsilon parameter ε(c|x). See SpNaBaMatrix.

Author(s)

Enrique Del Callejo Canal ([email protected]), based on implemented algortihms in web platform SPECIES (see References).

References

http://species.conabio.gob.mx/

Examples

 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)

# Probability calculation -----------------------------

x.probs <- probs(x.counts)

# Estimating epsilon ----------------------------------

x.eps <- epsilon(x.counts, x.probs)

edelcallejoc/rspecies documentation built on Dec. 17, 2018, 9:15 a.m.