summary.BayesECMpred {ezECM}R Documentation

Summary of Unlabeled Event Categorization

Description

Tabulates results from the predict.BayesECM() function for quick analysis.

Usage

## S3 method for class 'BayesECMpred'
summary(object, index = 1, category = 1, C = 1 - diag(2), ...)

Arguments

object

an object of class "BayesECMpred" obtained as the output from the predict.BayesECM() function.

index

integer stipulating the event of interest. Value corresponds to the row index of Ytilde previously supplied to predict.BayesECM()

category

integer for the index of the category of interest for hypothesis testing. Alternatively, a character string naming the category of interest can be provided.

C

square matrix of dimension 2, providing loss values to be used in hypothesis testing. See Details.

...

not used

Details

Expected Loss

summary.BayesECMpred() prints expected loss for the binary hypothesis stipulated by category. Expected loss is calculated using the loss matrix specified with argument C. The default values for C result in 0-1 loss being used. Format details for the loss matrix can be found in vignette("syn-data-code").

Typicality

Typicality indices are used in cECM_decision() as part of the decision criteria. Here, we have adapted typicality indices for use with a Bayesian ECM model for outlier detection, when a new observation may not be related to the categories used for training. Probability of the p-value being less than a significance level of 0.05 is reported. If no missing data is used for training, this probability is either 0 or 1.

Value

Prints a summary including probability of each category for the event stipulated by index, minimum expected loss for binary categorization, and probability of a-typicality of the event for the category specified by category.

Examples


csv_use <- "good_training.csv"
file_path <- system.file("extdata", csv_use, package = "ezECM")
training_data <- import_pvals(file = file_path, header = TRUE, sep = ",", training = TRUE)

trained_model <- BayesECM(Y = training_data, BT = c(10,1000))

csv_use <- "good_newdata.csv"
file_path <- system.file("extdata", csv_use, package = "ezECM")
new_data <- import_pvals(file = file_path, header = TRUE, sep = ",", training = TRUE)

bayespred <- predict(trained_model,  Ytilde = new_data)



[Package ezECM version 1.0.0 Index]