Add multy score to exreport

This commit is contained in:
2021-09-27 18:43:59 +02:00
parent 50cbc95919
commit 9adac5d1fd
7 changed files with 79 additions and 41 deletions

View File

@@ -1,13 +1,18 @@
csv_file <- "results/exreport.csv"
library(glue)
args = commandArgs(trailingOnly=TRUE)
if (length(args)!=1) {
stop("Only one argument must be supplied (score).n", call.=FALSE)
}
csv_file <- glue("results/exreport_{args[1]}.csv")
destination <- "exreport/"
results <- read.csv(csv_file)
library(exreport)
experiment <- expCreate(results, method="classifier", problem="dataset", name="Stree")
testAccuracy <- testMultipleControl(experiment, "accuracy", "max")
testAccuracy <- testMultipleControl(experiment, args[1], "max")
summary(testAccuracy)
table1 <- tabularTestSummary(testAccuracy, columns = c("pvalue", "rank", "wtl"))
table1
plot1 <- plotExpSummary(experiment, "accuracy", columns = 3)
plot1 <- plotExpSummary(experiment, args[1], columns = 3)
plot2 <- plotCumulativeRank(testAccuracy)
plot3 <- plotRankDistribution(testAccuracy)
@@ -26,7 +31,7 @@ report <- exreportAdd(report, list(plot1,plot2,table1,plot3))
# We have decided to generate the table at this point of the tutorial to discusse some special formating parameters of this function. Concretely, some of the tabular outputs generated by exreport have some properties that are only useful when rendering the objets in a graphic report, and have no effect in the object representation in the R console. In this case, we will tell the function to boldface the method that maximices the result for each column, and to split the table into to pieces when rendering.
# We create the table:
table2 <- tabularExpSummary(experiment, "accuracy", digits=4, format="f", boldfaceColumns="max", tableSplit=2)
table2 <- tabularExpSummary(experiment, args[1], digits=4, format="f", boldfaceColumns="max", tableSplit=2)
# And add it to the report:
report <- exreportAdd(report, table2)
# Now that we have finished adding elements to the report it is time to render it. We want to generate an HTML report, so we call the appropiate function, by default it renders and opens the report in your browser using a temporary file, but you can optionally specify a folder in which the report will be saved for future use.