evaluate_softmax: Evaluate matrices of true targets and predictions from layer...

View source: R/evaluation.R

evaluate_softmaxR Documentation

Evaluate matrices of true targets and predictions from layer with softmax activation.

Description

Compute confusion matrix, accuracy, categorical crossentropy and (optionally) AUC or AUPRC, given predictions and true targets. AUC and AUPRC only possible for 2 targets.

Usage

evaluate_softmax(y, y_conf, auc = FALSE, auprc = FALSE, label_names = NULL)

Arguments

y

Matrix of true target.

y_conf

Matrix of predictions.

auc

Whether to include AUC metric. Only possible for 2 targets.

auprc

Whether to include AUPRC metric. Only possible for 2 targets.

label_names

Names of corresponding labels. Length must be equal to number of columns of y.

Value

A list of evaluation results.

Examples


y <- matrix(c(1, 0, 0, 0, 1, 1), ncol = 2)
y_conf <- matrix(c(0.3, 0.5, 0.1, 0.7, 0.5, 0.9), ncol = 2)
evaluate_softmax(y, y_conf, auc = TRUE, auprc = TRUE, label_names = c("A", "B")) 


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