summarize_states: Create summary of predictions

View source: R/predict.R

summarize_statesR Documentation

Create summary of predictions

Description

Create summary data frame for confidence predictions over 1 or several state files or a data frame. Columns in file or data frame should be confidence predictions for one class, i.e. each rows should sum to 1 and have nonnegative entries. Output data frame contains average confidence scores, max score and percentage of votes for each class.

Usage

summarize_states(
  states_path = NULL,
  label_names = NULL,
  file_type = "h5",
  df = NULL
)

Arguments

states_path

Folder containing state files or a single file with same ending as file_type.

label_names

Names of predicted classes.

file_type

"h5" or "csv".

df

A states data frame. Ignore states_dir argument if not NULL.

Value

A data frame of predictions summaries.

Examples

m <- c(0.9,  0.1, 0.2, 0.01,
       0.05, 0.7, 0.2, 0,
       0.05, 0.2, 0.6, 0.99) %>% matrix(ncol = 3)

label_names <- paste0("class_", 1:3)
df <- as.data.frame(m)
pred_summary <- summarize_states(label_names = label_names, df = df)
pred_summary


GenomeNet/deepG documentation built on Dec. 24, 2024, 12:11 p.m.