Class LinearEuclid
- java.lang.Object
-
- org.aksw.limes.core.ml.algorithm.ACoreMLAlgorithm
-
- org.aksw.limes.core.ml.algorithm.euclid.LinearEuclid
-
- Direct Known Subclasses:
BooleanEuclid
public class LinearEuclid extends ACoreMLAlgorithm
Class wraps around EUCLIDs linear classifier to abide LIMES ml interface- Author:
- Klaus Lyko (lyko@informatik.uni-leipzig.de)
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringALGORITHM_NAMEstatic StringBETAstatic StringITERATIONS_MAXstatic StringKAPPAstatic StringLEARNING_RATEprotected LinearSelfConfiguratorlscThe EUCLID implementationstatic StringMIN_COVERAGEstatic StringMIN_THRESHOLDstatic StringSTRICT-
Fields inherited from class org.aksw.limes.core.ml.algorithm.ACoreMLAlgorithm
configuration, learningParameters, logger, sourceCache, targetCache
-
-
Constructor Summary
Constructors Constructor Description LinearEuclid()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MLResultsactiveLearn()Learning method for supervised active core ML algorithm implementations Normally, it is used as a first step to initialize the ML model before going through the active learning processprotected MLResultsactiveLearn(AMapping oracleMapping)Learning method for supervised active core ML algorithm implementations.protected voidconfigureEuclid(LinearSelfConfigurator lsc)To configure EUCLID implementation.protected StringgetName()Name of the core ML algorithm.protected AMappinggetNextExamples(int size)Get a set of examples to be added to the mapping.protected voidinit(List<LearningParameter> learningParameters, ACache sourceCache, ACache targetCache)Initialize the core ML algorithm.protected MLResultslearn()Common learning method for both supervised and unsupervised Euclids.protected MLResultslearn(PseudoFMeasure pfm)Learning method for unsupervised core ML algorithm implementations.protected MLResultslearn(AMapping trainingData)Learning method for supervised core ML algorithm implementations, where the confidence values for each pair in the trainingData determine its truth degree.protected AMappingpredict(ACache source, ACache target, MLResults mlModel)Predict/generate links from source to target based on mlModel.voidsetDefaultParameters()Set default ACoreMLAlgorithm parameters valuesprotected booleansupports(MLImplementationType mlType)Check whether the mlType is supported.-
Methods inherited from class org.aksw.limes.core.ml.algorithm.ACoreMLAlgorithm
getConfiguration, getParameter, getParameters, getSourceCache, getTargetCache, setConfiguration, setParameter
-
-
-
-
Field Detail
-
ALGORITHM_NAME
protected static final String ALGORITHM_NAME
- See Also:
- Constant Field Values
-
STRICT
public static final String STRICT
- See Also:
- Constant Field Values
-
ITERATIONS_MAX
public static final String ITERATIONS_MAX
- See Also:
- Constant Field Values
-
MIN_THRESHOLD
public static final String MIN_THRESHOLD
- See Also:
- Constant Field Values
-
KAPPA
public static final String KAPPA
- See Also:
- Constant Field Values
-
BETA
public static final String BETA
- See Also:
- Constant Field Values
-
LEARNING_RATE
public static final String LEARNING_RATE
- See Also:
- Constant Field Values
-
MIN_COVERAGE
public static final String MIN_COVERAGE
- See Also:
- Constant Field Values
-
lsc
protected LinearSelfConfigurator lsc
The EUCLID implementation
-
-
Method Detail
-
init
protected void init(List<LearningParameter> learningParameters, ACache sourceCache, ACache targetCache)
Description copied from class:ACoreMLAlgorithmInitialize the core ML algorithm.- Overrides:
initin classACoreMLAlgorithm- Parameters:
learningParameters- learning parameterssourceCache- the source cachetargetCache- the target cache
-
getName
protected String getName()
Description copied from class:ACoreMLAlgorithmName of the core ML algorithm.- Specified by:
getNamein classACoreMLAlgorithm- Returns:
- Name of the core ML algorithm.
-
setDefaultParameters
public void setDefaultParameters()
Description copied from class:ACoreMLAlgorithmSet default ACoreMLAlgorithm parameters values- Specified by:
setDefaultParametersin classACoreMLAlgorithm
-
learn
protected MLResults learn()
Common learning method for both supervised and unsupervised Euclids.- Returns:
- MLResults object containing a (equivalent) LS to the Euclids optimization method, a mapping, and eventually further detailed results.
-
learn
protected MLResults learn(AMapping trainingData) throws UnsupportedMLImplementationException
Description copied from class:ACoreMLAlgorithmLearning method for supervised core ML algorithm implementations, where the confidence values for each pair in the trainingData determine its truth degree.- Specified by:
learnin classACoreMLAlgorithm- Parameters:
trainingData- used for learning- Returns:
- wrap with results
- Throws:
UnsupportedMLImplementationException- if ML implementation is not supported
-
learn
protected MLResults learn(PseudoFMeasure pfm) throws UnsupportedMLImplementationException
Description copied from class:ACoreMLAlgorithmLearning method for unsupervised core ML algorithm implementations.- Specified by:
learnin classACoreMLAlgorithm- Parameters:
pfm- pseudo F-measure for unsupervised learning- Returns:
- wrap with results
- Throws:
UnsupportedMLImplementationException- if ML implementation is not supported
-
predict
protected AMapping predict(ACache source, ACache target, MLResults mlModel)
Description copied from class:ACoreMLAlgorithmPredict/generate links from source to target based on mlModel.- Specified by:
predictin classACoreMLAlgorithm- Parameters:
source- Cachetarget- CachemlModel- result of training phase- Returns:
- the mapping from source to target
-
supports
protected boolean supports(MLImplementationType mlType)
Description copied from class:ACoreMLAlgorithmCheck whether the mlType is supported.- Specified by:
supportsin classACoreMLAlgorithm- Parameters:
mlType- machine learning implementation type- Returns:
- a boolean value
-
getNextExamples
protected AMapping getNextExamples(int size) throws UnsupportedMLImplementationException
Description copied from class:ACoreMLAlgorithmGet a set of examples to be added to the mapping.- Specified by:
getNextExamplesin classACoreMLAlgorithm- Parameters:
size- of the examples- Returns:
- the mapping
- Throws:
UnsupportedMLImplementationException- Exception
-
activeLearn
protected MLResults activeLearn(AMapping oracleMapping) throws UnsupportedMLImplementationException
Description copied from class:ACoreMLAlgorithmLearning method for supervised active core ML algorithm implementations.- Specified by:
activeLearnin classACoreMLAlgorithm- Parameters:
oracleMapping- mapping from the oracle- Returns:
- wrap with results
- Throws:
UnsupportedMLImplementationException- if ML implementation is not supported
-
activeLearn
protected MLResults activeLearn() throws UnsupportedMLImplementationException
Description copied from class:ACoreMLAlgorithmLearning method for supervised active core ML algorithm implementations Normally, it is used as a first step to initialize the ML model before going through the active learning process- Specified by:
activeLearnin classACoreMLAlgorithm- Returns:
- wrap with results
- Throws:
UnsupportedMLImplementationException- if ML implementation is not supported
-
configureEuclid
protected void configureEuclid(LinearSelfConfigurator lsc)
To configure EUCLID implementation. Checks for new parameters and sets up EUCLID accordingly.
-
-