Class RetrieverEvaluationUtils
java.lang.Object
de.uni_trier.wi2.procake.utils.eval.RetrieverEvaluationUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <TCase extends DataObject>
List<SimpleSimilarityResult>computeGroundTruthSimilarities
(Retriever<TCase, Query> groundTruthRetriever, WriteableObjectPool<TCase> trainCaseBase, WriteableObjectPool<TCase> testCaseBase, String pathGroundTruthSimilarities) Computes the ground-truth similarities with the given ground-truth retriever.static <TCase extends DataObject>
List<SimpleSimilarityResult>computeGroundTruthSimilarities
(Retriever<TCase, Query> groundTruthRetriever, TrainingObjectPool<TCase> trainingObjectPool, String pathGroundTruthSimilarities) Computes the ground-truth similarities with the given ground-truth retriever.static List<SimpleSimilarityResult>
loadGroundTruthSimilarities
(String pathGroundTruthSimilarities) Loads the ground-truth similarities from file system at the specified path.static <TCase extends DataObject>
voidtestGroundTruthSimilarities
(WriteableObjectPool<TCase> trainCaseBase, WriteableObjectPool<TCase> testCaseBase, List<SimpleSimilarityResult> groundTruthSimilarities) Checks the ground-truth similarities by searching for every pair of query and case in them.static <TCase extends DataObject>
voidtestGroundTruthSimilarities
(TrainingObjectPool<TCase> trainingObjectPool, SimpleSimilarityCache similarityCache) Checks the ground-truth similarities by searching for every pair of query and case in them.static <TCase extends DataObject>
voidtestGroundTruthSimilarities
(TrainingObjectPool<TCase> trainingObjectPool, List<SimpleSimilarityResult> groundTruthSimilarities) Checks the ground-truth similarities by searching for every pair of query and case in them.static <TCase extends DataObject>
voidtestRetrievers
(WriteableObjectPool<TCase> trainPool, WriteableObjectPool<TCase> testPool, Map<String, Retriever<TCase, Query>> retrieverMap) Simple method to test all retrievers in retrieverMap prior to the actual evaluation.static <TCase extends DataObject>
voidtestRetrievers
(TrainingObjectPool<TCase> trainingObjectPool, Map<String, Retriever<TCase, Query>> retrieverMap) Simple method to test all retrievers in retrieverMap prior to the actual evaluation.
-
Constructor Details
-
RetrieverEvaluationUtils
public RetrieverEvaluationUtils()
-
-
Method Details
-
testRetrievers
public static <TCase extends DataObject> void testRetrievers(TrainingObjectPool<TCase> trainingObjectPool, Map<String, Retriever<TCase, throws RetrieverEvaluationExceptionQuery>> retrieverMap) Simple method to test all retrievers in retrieverMap prior to the actual evaluation.- Parameters:
trainingObjectPool
- Pool containing the train pool and the test pool.retrieverMap
- the map with completely initialized retrievers- Throws:
RetrieverEvaluationException
- if something goes wrong
-
testRetrievers
public static <TCase extends DataObject> void testRetrievers(WriteableObjectPool<TCase> trainPool, WriteableObjectPool<TCase> testPool, Map<String, Retriever<TCase, throws RetrieverEvaluationExceptionQuery>> retrieverMap) Simple method to test all retrievers in retrieverMap prior to the actual evaluation.- Parameters:
trainPool
- the train pooltestPool
- the test poolretrieverMap
- the map with completely initialized retrievers- Throws:
RetrieverEvaluationException
- if something goes wrong
-
loadGroundTruthSimilarities
public static List<SimpleSimilarityResult> loadGroundTruthSimilarities(String pathGroundTruthSimilarities) Loads the ground-truth similarities from file system at the specified path. This file is a CSV file. The loaded values are afterwards stored in groundTruthSimilaritiesMap.- Parameters:
pathGroundTruthSimilarities
- the path to the stored similarities (CSV file)- Returns:
- the loaded ground-truth similarities
-
computeGroundTruthSimilarities
public static <TCase extends DataObject> List<SimpleSimilarityResult> computeGroundTruthSimilarities(Retriever<TCase, Query> groundTruthRetriever, TrainingObjectPool<TCase> trainingObjectPool, String pathGroundTruthSimilarities) throws IOExceptionComputes the ground-truth similarities with the given ground-truth retriever. The computed values are afterwards stored in groundTruthSimilaritiesMap. Optionally, the computed similarities can also be stored as a CSV file for future usage.- Parameters:
groundTruthRetriever
- the ground-truth retrievertrainingObjectPool
- Pool containing the training case base and the test case base.pathGroundTruthSimilarities
- if this path is notnull
, the similarities will- Returns:
- the computed ground-truth similarities
- Throws:
IOException
-
computeGroundTruthSimilarities
public static <TCase extends DataObject> List<SimpleSimilarityResult> computeGroundTruthSimilarities(Retriever<TCase, Query> groundTruthRetriever, WriteableObjectPool<TCase> trainCaseBase, WriteableObjectPool<TCase> testCaseBase, String pathGroundTruthSimilarities) throws IOExceptionComputes the ground-truth similarities with the given ground-truth retriever. The computed values are afterwards stored in groundTruthSimilaritiesMap. Optionally, the computed similarities can also be stored as a CSV file for future usage.- Parameters:
groundTruthRetriever
- the ground-truth retrievertrainCaseBase
- the training case basetestCaseBase
- the test case basepathGroundTruthSimilarities
- if this path is notnull
, the similarities will- Returns:
- the computed ground-truth similarities
- Throws:
IOException
-
testGroundTruthSimilarities
public static <TCase extends DataObject> void testGroundTruthSimilarities(TrainingObjectPool<TCase> trainingObjectPool, List<SimpleSimilarityResult> groundTruthSimilarities) throws RetrieverEvaluationException Checks the ground-truth similarities by searching for every pair of query and case in them.- Parameters:
trainingObjectPool
- Pool containing the training case base and the test case base.groundTruthSimilarities
- the list of ground-truth similarities- Throws:
RetrieverEvaluationException
- if something goes wrong
-
testGroundTruthSimilarities
public static <TCase extends DataObject> void testGroundTruthSimilarities(TrainingObjectPool<TCase> trainingObjectPool, SimpleSimilarityCache similarityCache) throws RetrieverEvaluationException Checks the ground-truth similarities by searching for every pair of query and case in them.- Parameters:
trainingObjectPool
- Pool containing the training case base and the test case base.similarityCache
- the similarity cache to check- Throws:
RetrieverEvaluationException
- if something goes wrong
-
testGroundTruthSimilarities
public static <TCase extends DataObject> void testGroundTruthSimilarities(WriteableObjectPool<TCase> trainCaseBase, WriteableObjectPool<TCase> testCaseBase, List<SimpleSimilarityResult> groundTruthSimilarities) throws RetrieverEvaluationException Checks the ground-truth similarities by searching for every pair of query and case in them.- Parameters:
trainCaseBase
- the training case basetestCaseBase
- the test case basegroundTruthSimilarities
- the list of ground-truth similarities- Throws:
RetrieverEvaluationException
- if something goes wrong
-