Description Usage Arguments Value Slots Author(s) References Examples
SpNaBaCounts is used to store frequency information of the Naive Bayes model.
1 | SpNaBaCounts(N, Nc, Nx, Ncx, ...)
|
N |
|
Nc |
|
Nx |
|
Ncx |
|
... |
argument pass to other methods. |
An object of class SpNaBaCounts
. See slot section for more details.
N
numeric
of length 1. It contains the number of blocks of the partition
of the sample space. If the model is not for spatial data, N is the number of cases in the
sample. If the model is for spatial data, N is the number of cells in the grid
(see gr_build
).
Nc
numeric
. Each element represents the number of blocks with at least one
observation of target factor $c$. If the model is not for spatial data Nc
represents the number of cases with presences of target factor $c$. If the
model is for spatial data Nc represents the number of cell in the GRID
with at least one obervations of the target factor $c$.
Nx
numeric
. Each element represents the number of blocks with at least one
observation of predictor factor $x$. If the model is not for spatial data Nx
represents the number of cases with presences of predictor factor $x$. If the
model is for spatial data Nx represents the number of cell in the GRID
with at least one obervations of the predictor factor $x$.
Ncx
matrix
. Each element represents the number of blocks with at least one
observation of target factor $c$ and predictor factor $x$. If the model is not
for spatial data Ncx represents the joint frequency of target factor $c$ and
the predictor factor $x$. If the model is for spatial data Ncx represents the
number of cell in the GRID with at least one obervations of the target factor
$c$ and the predictor factor $x$.
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 | # Using SpNaBaMatrix constructor ----------------------
a <- matrix(rbinom(100, 100, runif(100)), nrow = 10, ncol = 10,
dimnames = list(paste0("id:", 1:10), letters[1:10]))
x.mat <- SpNaBaMatrix(freqmatrix = a)
SpNaBaCounts(N = nrow(x.mat@binmatrix),
Nc = colSums(x.mat@binmatrix),
Nx = colSums(x.mat@binmatrix),
Ncx = t(x.mat@binmatrix) %*% x.mat@binmatrix)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.