# bpamat: Matrices of Basic Probability Assignment Objects In MuViCP: MultiClass Visualizable Classification using Combination of Projections

## Description

These functions enhance the functionality provided via `bpa` objects. They essentially provide for the storage of several bpa objects at once as a matrix.

## Usage

 ```1 2 3``` ```bpamat(info = NULL, mat = NULL) ## S3 method for class 'bpamat' print(x, ...) ```

## Arguments

 `info` A piece of auxiliary information that you want stored along with the matrix of bpa's. (Used internally to store the random seed, or the special character `'C'` if the bpa object resulted from a combination.) `mat` The matrix of bpa's. Each column represents a point, and the rows represent classes. Should have column names set to the row names of the points, and row names set to the names of the classes `x` The bpamat object to be printed. `...` Additional arguments to print method. Not Used.

## Details

The `ensemble` function returns objects of this type.

## Value

The `bpamat` function returns a list of functions which can be used to query and / or manipulate the create bpa object.

 `set.info` Takes a single argument which is set as the auxiliary information you want stored with the matrix `get.info` Returns the auxiliary information stored with the matrix `assign.mat` Takes a single argument, which should be a matrix of bpa's, to be stored inside the bpamat object. `get.classify` Returns a vector as long as the number of points stored in the `bpamat` object. The elements are named after the points, and are the current classification of the point, based on the bpamat object. `get.point` Returns the bpa corresponding to a single point, whose name is passed as the argument. `get.mat` Returns the matrix of bpa's. `get.setlist` Returns the class names that occur in the current matrix `get.pointlist` Returns the names of all the points whose bpa's are stored in the current matrix.

## Author(s)

Mohit Dayal

bpa, combine.bpamat.bs, combine.bpamat.ds, combine.bpamat.list.bs, combine.bpamat.list.ds

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43``` ```data(cancer) table(cancer\$V2) colnames(cancer)[1:2] <- c('id', 'type') cancer.d <- as.matrix(cancer[,3:32]) labs <- cancer\$type test_size <- floor(0.15*nrow(cancer.d)) train <- sample(1:nrow(cancer.d), size = nrow(cancer.d) - test_size) test <- which(!(1:569 %in% train)) truelabs <- labs[test] projectron <- function(A) cancer.d %*% A kdebel <- kde_bel.builder(labs = labs[train], test = test, train = train) ##A projection seed1 <- .Random.seed F1 <- projectron(basis_random(30)) x1 <- kdebel(F1) y1 <- bpamat(info = seed1, mat = x1) y1 predicted1 <- y1\$get.classify() table(truelabs, predicted1) ##Another projection seed2 <- .Random.seed F2 <- projectron(basis_random(30)) x2 <- kdebel(F2) y2 <- bpamat(info = seed2, mat = x2) y2 predicted2 <- y2\$get.classify() table(truelabs, predicted2) z1 <- combine.bpamat.bs(y1, y2) z2 <- combine.bpamat.ds(y1, y2) table(truelabs, z1\$get.classify()) table(truelabs, z2\$get.classify()) ##Same result w1 <- combine.bpamat.list.bs(list(y1, y2)) w2 <- combine.bpamat.list.ds(list(y1, y2)) ```

### Example output

```Warning message:
no DISPLAY variable so Tk is not available

B   M
357 212
Warning message:
In crossprod(x[, j], x[, i]) * x[, i] :
Recycling array of length 1 in array-vector arithmetic is deprecated.

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE
call: fun(...)
A bpa mat object with information on 2 classes and 84 points
The following functions are available:
 "set.info"      "get.info"      "assign.mat"    "get.classify"
 "get.point"     "get.mat"       "get.setlist"   "get.pointlist"
predicted1
truelabs  B  M
B 50  0
M 11 24
Warning message:
In crossprod(x[, j], x[, i]) * x[, i] :
Recycling array of length 1 in array-vector arithmetic is deprecated.

A bpa mat object with information on 2 classes and 84 points
The following functions are available:
 "set.info"      "get.info"      "assign.mat"    "get.classify"
 "get.point"     "get.mat"       "get.setlist"   "get.pointlist"
predicted2
truelabs  B  M
B 50  0
M 10 25

truelabs  B  M
B 50  0
M 10 25

truelabs  B Inf  M
B 50   0  0
M 10   1 24
```

MuViCP documentation built on May 1, 2019, 7:56 p.m.