diff --git a/openbr/core/eval.cpp b/openbr/core/eval.cpp index 6bac685..e0d9d41 100755 --- a/openbr/core/eval.cpp +++ b/openbr/core/eval.cpp @@ -376,11 +376,11 @@ float Evaluate(const Mat &simmat, const Mat &mask, const File &csv, const QStrin QString::number(1-searchOperatingPoint.TAR))); } - // Write TAR@FAR Table (TF) + // Write FRR@FAR Table (FF) foreach (float FAR, QList() << 1e-6 << 1e-5 << 1e-4 << 1e-3 << 1e-2 << 1e-1) - lines.append(qPrintable(QString("TF,%1,%2").arg( + lines.append(qPrintable(QString("FF,%1,%2").arg( QString::number(FAR, 'f'), - QString::number(getOperatingPoint(operatingPoints, "FAR", FAR).TAR, 'f', 3)))); + QString::number(1-getOperatingPoint(operatingPoints, "FAR", FAR).TAR, 'f', 6)))); // Write FAR@TAR Table (FT) foreach (float TAR, QList() << 0.4 << 0.5 << 0.65 << 0.75 << 0.85 << 0.95) diff --git a/openbr/core/plot.cpp b/openbr/core/plot.cpp index 6fa5bb7..eb033e0 100644 --- a/openbr/core/plot.cpp +++ b/openbr/core/plot.cpp @@ -180,13 +180,13 @@ bool Plot(const QStringList &files, const File &destination, bool show) RPlot p(files, destination); p.file.write("\nformatData()\n\n"); - p.file.write(qPrintable(QString("algs <- %1\n").arg((p.major.size > 1 && p.minor.size > 1) && !(p.major.smooth || p.minor.smooth) ? QString("paste(TF$%1, TF$%2, sep=\"_\")").arg(p.major.header, p.minor.header) - : QString("TF$%1").arg(p.major.size > 1 ? p.major.header : (p.minor.header.isEmpty() ? p.major.header : p.minor.header))))); + p.file.write(qPrintable(QString("algs <- %1\n").arg((p.major.size > 1 && p.minor.size > 1) && !(p.major.smooth || p.minor.smooth) ? QString("paste(FF$%1, FF$%2, sep=\"_\")").arg(p.major.header, p.minor.header) + : QString("FF$%1").arg(p.major.size > 1 ? p.major.header : (p.minor.header.isEmpty() ? p.major.header : p.minor.header))))); p.file.write("algs <- algs[!duplicated(algs)]\n"); if (p.major.smooth || p.minor.smooth) { QString groupvar = p.major.size > 1 ? p.major.header : (p.minor.header.isEmpty() ? p.major.header : p.minor.header); - foreach(const QString &data, QStringList() << "DET" << "IET" << "CMC" << "TF" << "FT" << "CT") { + foreach(const QString &data, QStringList() << "DET" << "IET" << "CMC" << "FF" << "FT" << "CT") { p.file.write(qPrintable(QString("%1 <- summarySE(%1, measurevar=\"Y\", groupvars=c(\"%2\", \"X\"), conf.interval=confidence)" "\n").arg(data, groupvar))); } @@ -214,8 +214,8 @@ bool Plot(const QStringList &files, const File &destination, bool show) // optional plot metadata and accuracy tables if (destination.getBool("metadata", true)) { - p.file.write("plotTAR(tableData=TF)\n"); - p.file.write("plotTAR(tableData=TF,operatingPoint=1e-6)\n"); + p.file.write("plotFRR(tableData=FF)\n"); + p.file.write("plotFRR(tableData=FF,operatingPoint=1e-6)\n"); } // Write plots @@ -375,12 +375,12 @@ bool PlotEER(const QStringList &files, const File &destination, bool show) RPlot p(files, destination); p.file.write("\nformatData()\n\n"); - p.file.write(qPrintable(QString("algs <- %1\n").arg((p.major.size > 1 && p.minor.size > 1) && !(p.major.smooth || p.minor.smooth) ? QString("paste(TF$%1, TF$%2, sep=\"_\")").arg(p.major.header, p.minor.header) - : QString("TF$%1").arg(p.major.size > 1 ? p.major.header : (p.minor.header.isEmpty() ? p.major.header : p.minor.header))))); + p.file.write(qPrintable(QString("algs <- %1\n").arg((p.major.size > 1 && p.minor.size > 1) && !(p.major.smooth || p.minor.smooth) ? QString("paste(FF$%1, FF$%2, sep=\"_\")").arg(p.major.header, p.minor.header) + : QString("FF$%1").arg(p.major.size > 1 ? p.major.header : (p.minor.header.isEmpty() ? p.major.header : p.minor.header))))); p.file.write("algs <- algs[!duplicated(algs)]\n"); if (p.major.smooth || p.minor.smooth) { QString groupvar = p.major.size > 1 ? p.major.header : (p.minor.header.isEmpty() ? p.major.header : p.minor.header); - foreach(const QString &data, QStringList() << "DET" << "TF" << "FT") { + foreach(const QString &data, QStringList() << "DET" << "FF" << "FT") { p.file.write(qPrintable(QString("%1 <- summarySE(%1, measurevar=\"Y\", groupvars=c(\"%2\", \"X\"), conf.interval=confidence)" "\n").arg(data, groupvar))); } diff --git a/share/openbr/plotting/plot_utils.R b/share/openbr/plotting/plot_utils.R index c60a3ba..9620564 100644 --- a/share/openbr/plotting/plot_utils.R +++ b/share/openbr/plotting/plot_utils.R @@ -62,7 +62,7 @@ plotTable <- function(tableData=NULL, name=NULL, labels=NULL) { } } -plotTAR <- function(tableData=NULL, operatingPoint=1e-4) { +plotFRR <- function(tableData=NULL, operatingPoint=1e-4) { if (nrow(tableData) == 0) return() major <- majorHeader minor <- if(minorHeader == "") majorHeader else minorHeader @@ -71,8 +71,10 @@ plotTAR <- function(tableData=NULL, operatingPoint=1e-4) { colnames(mat) <- tableData[,minor][!duplicated(tableData[,minor])] rownames(mat) <- tableData[,major][!duplicated(tableData[,major])] table <- as.table(mat) + options(scipen = 999) print(textplot(table)) - print(title(paste("True Accept Rate at FAR=", toString(operatingPoint)))) + options(scipen = 0) + print(title(paste("False Reject Rate at FAR=", toString(operatingPoint)))) } plotLandmarkTables <- function(tableData=NULL) { @@ -179,7 +181,7 @@ formatData <- function(type="eval") { FAR <<- data[grep("FAR",data$Plot),-c(1)] FRR <<- data[grep("FRR",data$Plot),-c(1)] SD <<- data[grep("SD",data$Plot),-c(1)] - TF <<- data[grep("TF",data$Plot),-c(1)] + FF <<- data[grep("FF",data$Plot),-c(1)] FT <<- data[grep("FT",data$Plot),-c(1)] CT <<- data[grep("CT",data$Plot),-c(1)] BC <<- data[grep("BC",data$Plot),-c(1)] @@ -195,7 +197,7 @@ formatData <- function(type="eval") { FAR$Y <<- as.numeric(as.character(FAR$Y)) FRR$Y <<- as.numeric(as.character(FRR$Y)) SD$Y <<- as.factor(unique(as.character(SD$Y))) - TF$Y <<- as.numeric(as.character(TF$Y)) + FF$Y <<- as.numeric(as.character(FF$Y)) FT$Y <<- as.numeric(as.character(FT$Y)) CT$Y <<- as.numeric(as.character(CT$Y)) BC$Y <<- as.numeric(as.character(BC$Y))