--- a +++ b/man/summarize_states.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/predict.R +\name{summarize_states} +\alias{summarize_states} +\title{Create summary of predictions} +\usage{ +summarize_states( + states_path = NULL, + label_names = NULL, + file_type = "h5", + df = NULL +) +} +\arguments{ +\item{states_path}{Folder containing state files or a single file with same ending as \code{file_type}.} + +\item{label_names}{Names of predicted classes.} + +\item{file_type}{\code{"h5"} or \code{"csv"}.} + +\item{df}{A states data frame. Ignore \code{states_dir} argument if not \code{NULL}.} +} +\value{ +A data frame of predictions summaries. +} +\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. +} +\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 + +}