lol.project.bayes_optimal {lolR}R Documentation

Bayes Optimal

Description

A function for recovering the Bayes Optimal Projection, which optimizes Bayes classification.

Usage

lol.project.bayes_optimal(X, Y, mus, Sigmas, priors, ...)

Arguments

X

[n, p] the data with n samples in d dimensions.

Y

[n] the labels of the samples with K unique labels.

mus

[d, K] the K class means in d dimensions.

Sigmas

[d, d, K] the K class covariance matrices in d dimensions.

priors

[K] the priors for each of the K classes.

...

optional args.

Value

A list of class embedding containing the following:

A

[d, K] the projection matrix from d to K dimensions.

d

the eigen values associated with the eigendecomposition.

ylabs

[K] vector containing the K unique, ordered class labels.

centroids

[K, d] centroid matrix of the K unique, ordered classes in native d dimensions.

priors

[K] vector containing the K prior probabilities for the unique, ordered classes.

Xr

[n, K] the n data points in reduced dimensionality K.

cr

[K, K] the K centroids in reduced dimensionality K.

Author(s)

Eric Bridgeford

Examples

library(lolR)
data <- lol.sims.rtrunk(n=200, d=30)  # 200 examples of 30 dimensions
X <- data$X; Y <- data$Y
# obtain bayes-optimal projection of the data
model <- lol.project.bayes_optimal(X=X, Y=Y, mus=data$mus,
                                   S=data$Sigmas, priors=data$priors)

[Package lolR version 2.1 Index]