Class TAPEvaluator
- java.lang.Object
-
- de.julielab.genemapper.evaluation.tools.TAPEvaluator
-
public class TAPEvaluator extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTAPEvaluator.TapInputLinestatic classTAPEvaluator.TapInputListstatic classTAPEvaluator.TapResultstatic classTAPEvaluator.TapResultListstatic classTAPEvaluator.TapResultRecord
-
Field Summary
Fields Modifier and Type Field Description static FileTAP_EXECstatic FileTAP_EXEC_WORKING_DIRFiletapInputDirFiletapStatsDir
-
Constructor Summary
Constructors Constructor Description TAPEvaluator()TAPEvaluator(File tapStatsDir)TAPEvaluator(File tapInputDir, File tapStatsDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TAPEvaluator.TapResultevaluate(String evaluationRunId, com.google.common.collect.Multimap<String,String> gold, com.google.common.collect.Multimap<String,de.julielab.geneexpbase.genemodel.GeneMention> predicted, Function<de.julielab.geneexpbase.candidateretrieval.SynHit,Double> confidenceFunction)Writes the TAP input file from the given gold and predicted data and runs the TAP evaluation script viaevaluate(String, File, File)-TAPEvaluator.TapResultevaluate(String evaluationRunId, File tapInputDir, File tapInputFile)Carries out the evaluation on the tapInputFile.List<TAPEvaluator.TapInputList>makeTapInputLists(String evaluationRunId, com.google.common.collect.Multimap<String,String> gold, com.google.common.collect.Multimap<String,de.julielab.geneexpbase.genemodel.GeneMention> predicted, Function<de.julielab.geneexpbase.candidateretrieval.SynHit,Double> confidenceFunction)Creates a representation of TAP input lists.voidsetK(String[] k)Sets the evaluation points in number of errors.voidwriteTapInputFile(File tapInputFile, String evaluationRunId, com.google.common.collect.Multimap<String,String> gold, com.google.common.collect.Multimap<String,de.julielab.geneexpbase.genemodel.GeneMention> predicted, Function<de.julielab.geneexpbase.candidateretrieval.SynHit,Double> confidenceFunction)Writes TAP input list data created bymakeTapInputLists(String, Multimap, Multimap, Function)to tapInputFile.
-
-
-
Method Detail
-
setK
public void setK(String[] k)
Sets the evaluation points in number of errors.- Parameters:
k-
-
evaluate
public TAPEvaluator.TapResult evaluate(String evaluationRunId, com.google.common.collect.Multimap<String,String> gold, com.google.common.collect.Multimap<String,de.julielab.geneexpbase.genemodel.GeneMention> predicted, Function<de.julielab.geneexpbase.candidateretrieval.SynHit,Double> confidenceFunction) throws IOException
Writes the TAP input file from the given gold and predicted data and runs the TAP evaluation script viaevaluate(String, File, File)-- Parameters:
evaluationRunId-gold-predicted-confidenceFunction-- Returns:
- Throws:
IOException
-
evaluate
public TAPEvaluator.TapResult evaluate(String evaluationRunId, File tapInputDir, File tapInputFile) throws IOException
Carries out the evaluation on the tapInputFile.- Parameters:
evaluationRunId-tapInputDir-tapInputFile-- Returns:
- Throws:
IOException
-
makeTapInputLists
public List<TAPEvaluator.TapInputList> makeTapInputLists(String evaluationRunId, com.google.common.collect.Multimap<String,String> gold, com.google.common.collect.Multimap<String,de.julielab.geneexpbase.genemodel.GeneMention> predicted, Function<de.julielab.geneexpbase.candidateretrieval.SynHit,Double> confidenceFunction)
Creates a representation of TAP input lists. Each list is sorted ascending according to the passed confidence function.
The input lists are sorted by the name of the lists in the returned value.
- Parameters:
evaluationRunId-gold-predicted-confidenceFunction-- Returns:
-
writeTapInputFile
public void writeTapInputFile(File tapInputFile, String evaluationRunId, com.google.common.collect.Multimap<String,String> gold, com.google.common.collect.Multimap<String,de.julielab.geneexpbase.genemodel.GeneMention> predicted, Function<de.julielab.geneexpbase.candidateretrieval.SynHit,Double> confidenceFunction) throws IOException
Writes TAP input list data created bymakeTapInputLists(String, Multimap, Multimap, Function)to tapInputFile.- Parameters:
tapInputFile-evaluationRunId-gold-predicted-confidenceFunction-- Throws:
IOException
-
-