Class Dragon
- java.lang.Object
-
- org.aksw.limes.core.ml.algorithm.ACoreMLAlgorithm
-
- org.aksw.limes.core.ml.algorithm.dragon.Dragon
-
public class Dragon extends ACoreMLAlgorithm
This class uses decision trees and an active learning approach to learn link specifications- Author:
- Daniel Obraczka < soz11ffe@ studserv.uni-leipzig.de>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDragon.SourceTargetValueHelper class for easier handling of links or link candidates
-
Field Summary
Fields Modifier and Type Field Description static Set<String>defaultMeasuresstatic StringFITNESS_NAME_GINI_INDEXstatic StringFITNESS_NAME_GLOBAL_FMEASUREstatic StringPARAMETER_ATOMIC_MEASURESstatic StringPARAMETER_FITNESS_FUNCTIONstatic StringPARAMETER_MAPPINGstatic StringPARAMETER_MAX_LINK_SPEC_HEIGHTstatic StringPARAMETER_MIN_PROPERTY_COVERAGEstatic StringPARAMETER_PROPERTY_LEARNING_RATEstatic StringPARAMETER_PROPERTY_MAPPINGstatic StringPARAMETER_PRUNING_CONFIDENCEstatic StringPARAMETER_PRUNING_FUNCTIONstatic StringPRUNING_NAME_ERROR_ESTIMATE_PRUNINGstatic StringPRUNING_NAME_GLOBAL_FMEASUREDecisionTreerootstatic doublethreshold-
Fields inherited from class org.aksw.limes.core.ml.algorithm.ACoreMLAlgorithm
learningParameters, sourceCache, targetCache
-
-
Constructor Summary
Constructors Constructor Description Dragon()Dragon constructor.Dragon(Configuration c)Constructor uses superconstructor, initializes TreeParser object and sets configuration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MLResultsactiveLearn()generates an initial training set and callsactiveLearn(AMapping)protected MLResultsactiveLearn(AMapping oracleMapping)Creates a training set out of the oracleMapping and usesJ48to build a decision tree The decision tree gets parsed to aLinkSpecificationvoidgetAtomicMeasures()ConfigurationgetConfiguration()MLResultsgetMlresult()StringgetName()Name of the core ML algorithm.protected AMappinggetNextExamples(int size)Get a set of examples to be added to the mapping.ACachegetSourceCache()ACachegetTargetCache()ACachegetTestSourceCache()ACachegetTestTargetCache()voidinit(List<LearningParameter> lp, ACache sourceCache, ACache targetCache)Initialize the core ML algorithm.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.AMappingpredict(ACache source, ACache target, MLResults mlModel)Predict/generate links from source to target based on mlModel.voidsetConfiguration(Configuration configuration)voidsetDefaultParameters()Set default ACoreMLAlgorithm parameters valuesvoidsetInitialMapping(AMapping initialMapping)voidsetSourceCache(ACache sourceCache)voidsetTargetCache(ACache targetCache)protected booleansupports(MLImplementationType mlType)Check whether the mlType is supported.-
Methods inherited from class org.aksw.limes.core.ml.algorithm.ACoreMLAlgorithm
getParameter, getParameters, setParameter
-
-
-
-
Field Detail
-
PARAMETER_PRUNING_CONFIDENCE
public static final String PARAMETER_PRUNING_CONFIDENCE
- See Also:
- Constant Field Values
-
PARAMETER_PROPERTY_MAPPING
public static final String PARAMETER_PROPERTY_MAPPING
- See Also:
- Constant Field Values
-
PARAMETER_MAPPING
public static final String PARAMETER_MAPPING
- See Also:
- Constant Field Values
-
PARAMETER_MAX_LINK_SPEC_HEIGHT
public static final String PARAMETER_MAX_LINK_SPEC_HEIGHT
- See Also:
- Constant Field Values
-
PARAMETER_MIN_PROPERTY_COVERAGE
public static final String PARAMETER_MIN_PROPERTY_COVERAGE
- See Also:
- Constant Field Values
-
PARAMETER_PROPERTY_LEARNING_RATE
public static final String PARAMETER_PROPERTY_LEARNING_RATE
- See Also:
- Constant Field Values
-
PARAMETER_FITNESS_FUNCTION
public static final String PARAMETER_FITNESS_FUNCTION
- See Also:
- Constant Field Values
-
PARAMETER_PRUNING_FUNCTION
public static final String PARAMETER_PRUNING_FUNCTION
- See Also:
- Constant Field Values
-
PARAMETER_ATOMIC_MEASURES
public static final String PARAMETER_ATOMIC_MEASURES
- See Also:
- Constant Field Values
-
FITNESS_NAME_GINI_INDEX
public static final String FITNESS_NAME_GINI_INDEX
- See Also:
- Constant Field Values
-
FITNESS_NAME_GLOBAL_FMEASURE
public static final String FITNESS_NAME_GLOBAL_FMEASURE
- See Also:
- Constant Field Values
-
PRUNING_NAME_ERROR_ESTIMATE_PRUNING
public static final String PRUNING_NAME_ERROR_ESTIMATE_PRUNING
- See Also:
- Constant Field Values
-
PRUNING_NAME_GLOBAL_FMEASURE
public static final String PRUNING_NAME_GLOBAL_FMEASURE
- See Also:
- Constant Field Values
-
root
public DecisionTree root
-
threshold
public static final double threshold
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Dragon
public Dragon()
Dragon constructor.
-
Dragon
public Dragon(Configuration c)
Constructor uses superconstructor, initializes TreeParser object and sets configuration- Parameters:
c-
-
-
Method Detail
-
getName
public String getName()
Description copied from class:ACoreMLAlgorithmName of the core ML algorithm.- Specified by:
getNamein classACoreMLAlgorithm- Returns:
- Name of the core ML algorithm.
-
activeLearn
protected MLResults activeLearn() throws UnsupportedMLImplementationException
generates an initial training set and callsactiveLearn(AMapping)- Specified by:
activeLearnin classACoreMLAlgorithm- Returns:
- wrap with results
- Throws:
UnsupportedMLImplementationException- if ML implementation is not supported
-
getAtomicMeasures
public void getAtomicMeasures()
-
activeLearn
protected MLResults activeLearn(AMapping oracleMapping) throws UnsupportedMLImplementationException
Creates a training set out of the oracleMapping and usesJ48to build a decision tree The decision tree gets parsed to aLinkSpecification- Specified by:
activeLearnin classACoreMLAlgorithm- Parameters:
oracleMapping-- Returns:
- res wrapper containing learned link specification
- Throws:
UnsupportedMLImplementationException- if ML implementation is not supported
-
predict
public 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
-
init
public void init(List<LearningParameter> lp, ACache sourceCache, ACache targetCache)
Description copied from class:ACoreMLAlgorithmInitialize the core ML algorithm.- Overrides:
initin classACoreMLAlgorithm- Parameters:
lp- learning parameterssourceCache- the source cachetargetCache- the target cache
-
setDefaultParameters
public void setDefaultParameters()
Description copied from class:ACoreMLAlgorithmSet default ACoreMLAlgorithm parameters values- Specified by:
setDefaultParametersin classACoreMLAlgorithm
-
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
-
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
-
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
-
getSourceCache
public ACache getSourceCache()
- Overrides:
getSourceCachein classACoreMLAlgorithm- Returns:
- the source cache
-
getTargetCache
public ACache getTargetCache()
- Overrides:
getTargetCachein classACoreMLAlgorithm- Returns:
- the target cache
-
setSourceCache
public void setSourceCache(ACache sourceCache)
-
setTargetCache
public void setTargetCache(ACache targetCache)
-
getConfiguration
public Configuration getConfiguration()
- Overrides:
getConfigurationin classACoreMLAlgorithm- Returns:
- the configuration
-
setConfiguration
public void setConfiguration(Configuration configuration)
- Overrides:
setConfigurationin classACoreMLAlgorithm- Parameters:
configuration- the configuration
-
getMlresult
public MLResults getMlresult()
-
setInitialMapping
public void setInitialMapping(AMapping initialMapping)
-
getTestSourceCache
public ACache getTestSourceCache()
-
getTestTargetCache
public ACache getTestTargetCache()
-
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
-
-