Class CacheTrimmer
- java.lang.Object
-
- org.aksw.limes.core.ml.algorithm.eagle.util.CacheTrimmer
-
public class CacheTrimmer extends Object
- Author:
- Klaus Lyko
-
-
Constructor Summary
Constructors Constructor Description CacheTrimmer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AMappinggetRandomTrainingData(AMapping m, int max)Another implementation to get a random training data of size max out of the reference mapping m.AMappinggetReferenceMapping()static ACache[]processData(ACache sC, ACache tC, AMapping m)Method to scale down the Caches used to perform entity matching upon.ACache[]processDataEqually(ACache hc1, ACache hc2, AMapping m, int numberOfQuestions)static AMappingtrimExamples(AMapping m, int max)Method to scale down a reference mapping given by an Oracle.static AMappingtrimExamplesRandomly(AMapping m, int max)Standard implementation to get random training examples.
-
-
-
Method Detail
-
trimExamples
public static AMapping trimExamples(AMapping m, int max)
Method to scale down a reference mapping given by an Oracle. Only the first maxEntriesare used.- Parameters:
m- Oracle holding all data.max- number of examples- Returns:
Mappingscaled down to max entries.
-
trimExamplesRandomly
public static AMapping trimExamplesRandomly(AMapping m, int max)
Standard implementation to get random training examples. Basic approach is to get a random set of source uris of the reference mapping and for each one target uri it is mapped to!- Parameters:
m- Mappingmax- number of examples- Returns:
- AMapping
-
getRandomTrainingData
public static AMapping getRandomTrainingData(AMapping m, int max)
Another implementation to get a random training data of size max out of the reference mapping m. The approach here is to randomly select source URIs of m and for each add ALL target URIs it is mapped to.- Parameters:
m- Mappingmax- number of examples- Returns:
- AMapping
-
processData
public static ACache[] processData(ACache sC, ACache tC, AMapping m)
Method to scale down the Caches used to perform entity matching upon. Scaling down is done according to the given reference mapping. Returns Caches only holding instances of the reference Mapping.- Parameters:
sC- Cache for source data.tC- Cache for target data.m- Reference Mapping (e.g. part of the optimal mapping)- Returns:
- Array holding both resulting Caches, where the Cache for the source is at index 0. Cache for the target knowledge base at index 1.
-
processDataEqually
public ACache[] processDataEqually(ACache hc1, ACache hc2, AMapping m, int numberOfQuestions)
-
getReferenceMapping
public AMapping getReferenceMapping()
- Returns:
- reference mapping
-
-