Commit 71b3f99e3bfc4b46a65b7ed1a94e5055855330ef

Authored by Scott Klum
1 parent 5e474ce8

Add multiple operating points to evaluation tables

openbr/core/plot.cpp
@@ -213,8 +213,10 @@ bool Plot(const QStringList &files, const File &destination, bool show) @@ -213,8 +213,10 @@ bool Plot(const QStringList &files, const File &destination, bool show)
213 } 213 }
214 214
215 // optional plot metadata and accuracy tables 215 // optional plot metadata and accuracy tables
216 - if (destination.getBool("metadata", true)) 216 + if (destination.getBool("metadata", true)) {
217 p.file.write("plotTAR(tableData=TF)\n"); 217 p.file.write("plotTAR(tableData=TF)\n");
  218 + p.file.write("plotTAR(tableData=TF,operatingPoint=1e-6)\n");
  219 + }
218 220
219 // Write plots 221 // Write plots
220 QString plot = "plot <- plotLine(lineData=%1, options=list(%2), flipY=%3)\nplot\n"; 222 QString plot = "plot <- plotLine(lineData=%1, options=list(%2), flipY=%3)\nplot\n";
share/openbr/plotting/plot_utils.R
@@ -62,17 +62,17 @@ plotTable &lt;- function(tableData=NULL, name=NULL, labels=NULL) { @@ -62,17 +62,17 @@ plotTable &lt;- function(tableData=NULL, name=NULL, labels=NULL) {
62 } 62 }
63 } 63 }
64 64
65 -plotTAR <- function(tableData=NULL) { 65 +plotTAR <- function(tableData=NULL, operatingPoint=1e-4) {
66 if (nrow(tableData) == 0) return() 66 if (nrow(tableData) == 0) return()
67 major <- majorHeader 67 major <- majorHeader
68 minor <- if(minorHeader == "") majorHeader else minorHeader 68 minor <- if(minorHeader == "") majorHeader else minorHeader
69 - tableData <- tableData[grep(1e-4,tableData$X),] 69 + tableData <- tableData[grep(operatingPoint,tableData$X),]
70 mat <- matrix(tableData$Y, nrow=length(tableData[,major][!duplicated(tableData[,major])]), ncol=length(tableData[,minor][!duplicated(tableData[,minor])]), byrow=FALSE) 70 mat <- matrix(tableData$Y, nrow=length(tableData[,major][!duplicated(tableData[,major])]), ncol=length(tableData[,minor][!duplicated(tableData[,minor])]), byrow=FALSE)
71 colnames(mat) <- tableData[,minor][!duplicated(tableData[,minor])] 71 colnames(mat) <- tableData[,minor][!duplicated(tableData[,minor])]
72 rownames(mat) <- tableData[,major][!duplicated(tableData[,major])] 72 rownames(mat) <- tableData[,major][!duplicated(tableData[,major])]
73 table <- as.table(mat) 73 table <- as.table(mat)
74 print(textplot(table)) 74 print(textplot(table))
75 - print(title("True Accept Rate at FAR=1e-4")) 75 + print(title(paste("True Accept Rate at FAR=", toString(operatingPoint))))
76 } 76 }
77 77
78 plotLandmarkTables <- function(tableData=NULL) { 78 plotLandmarkTables <- function(tableData=NULL) {