Package org.aksw.limes.core.ml.algorithm
Class WombatSimple
- java.lang.Object
-
- org.aksw.limes.core.ml.algorithm.ACoreMLAlgorithm
-
- org.aksw.limes.core.ml.algorithm.wombat.AWombat
-
- org.aksw.limes.core.ml.algorithm.WombatSimple
-
public class WombatSimple extends AWombat
Simple implementation of the Wombat algorithm Fast implementation, that is not complete- Version:
- Jun 7, 2016
- Author:
- Mohamed Sherif (sherif@informatik.uni-leipzig.de)
-
-
Field Summary
-
Fields inherited from class org.aksw.limes.core.ml.algorithm.wombat.AWombat
isUnsupervised, PARAMETER_ATOMIC_MEASURES, PARAMETER_CHILDREN_PENALTY_WEIGHT, PARAMETER_COMPLEXITY_PENALTY_WEIGHT, PARAMETER_EXECUTION_TIME_IN_MINUTES, PARAMETER_FMEASURE_BETA, PARAMETER_MAX_FITNESS_THRESHOLD, PARAMETER_MAX_ITERATION_TIME_IN_MINUTES, PARAMETER_MAX_ITERATIONS_NUMBER, PARAMETER_MAX_REFINEMENT_TREE_SIZE, PARAMETER_MIN_PROPERTY_COVERAGE, PARAMETER_OVERALL_PENALTY_WEIGHT, PARAMETER_PROPERTY_LEARNING_RATE, PARAMETER_SAVE_MAPPING, PARAMETER_VERBOSE, pseudoFMeasure, sourcePropertiesCoverageMap, sourceSample, sourceUris, sourceVariable, targetPropertiesCoverageMap, targetSample, targetUris, targetVariable, trainingData, wombatParameterNames
-
Fields inherited from class org.aksw.limes.core.ml.algorithm.ACoreMLAlgorithm
configuration, learningParameters, sourceCache, targetCache
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWombatSimple()WombatSimple constructor.
-
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 voidcreateRefinementTreeRoot()initiate the refinement tree as a root node with set of children nodes containing all initial classifiersRefinementNodefindBestSolution()protected List<RefinementNode>getBestKNodes(Tree<RefinementNode> r, int k)protected StringgetName()Name of the core ML algorithm.protected AMappinggetNextExamples(int size)Get a set of examples to be added to the mapping.protected TreeSet<RefinementNode>getSortedNodes(Tree<RefinementNode> r, double penaltyWeight, TreeSet<RefinementNode> result)protected 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.protected booleansupports(MLImplementationType mlType)Check whether the mlType is supported.protected voidupdateScores(Tree<RefinementNode> r)update F-Measure of the refinement tree r based on either training data or PFM-
Methods inherited from class org.aksw.limes.core.ml.algorithm.wombat.AWombat
createNode, fillSampleSourceTargetCaches, findInitialClassifiers, fMeasure, getAtomicMeasures, getBestNode, getBeta, getChildrenPenaltyWeight, getComplexityPenaltyWeight, getExcutionTimeInMinutes, getIterationTimeInMinutes, getMappingOfMetricExpression, getMaxFitnessThreshold, getMaxIterationNumber, getMaxRefinmentTreeSize, getMinPropertyCoverage, getMostPromisingNode, getOverAllPenaltyWeight, getPropertyLearningRate, isUnsupervised, isVerbose, precision, predict, recall, saveMapping, setDefaultParameters
-
Methods inherited from class org.aksw.limes.core.ml.algorithm.ACoreMLAlgorithm
getConfiguration, getParameter, getParameters, getSourceCache, getTargetCache, setConfiguration, setParameter
-
-
-
-
Method Detail
-
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.
-
init
protected void init(List<LearningParameter> lp, ACache sourceCache, ACache targetCache)
Description copied from class:ACoreMLAlgorithmInitialize the core ML algorithm.
-
learn
protected MLResults learn(AMapping trainingData)
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
-
learn
protected MLResults learn(PseudoFMeasure pfm)
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
-
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()
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
-
activeLearn
protected MLResults activeLearn(AMapping oracleMapping)
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
-
updateScores
protected void updateScores(Tree<RefinementNode> r)
update F-Measure of the refinement tree r based on either training data or PFM- Parameters:
r- refinement tree
-
findBestSolution
public RefinementNode findBestSolution()
- Returns:
- RefinementNode containing the best over all solution
-
getBestKNodes
protected List<RefinementNode> getBestKNodes(Tree<RefinementNode> r, int k)
- Parameters:
r- the root of the refinement treek- number of best nodes- Returns:
- sorted list of best k tree nodes
-
getSortedNodes
protected TreeSet<RefinementNode> getSortedNodes(Tree<RefinementNode> r, double penaltyWeight, TreeSet<RefinementNode> result)
- Parameters:
r- the root of the refinement treepenaltyWeight- from 0 to 1result- refinment tree- Returns:
- sorted list of tree nodes
-
createRefinementTreeRoot
protected void createRefinementTreeRoot()
initiate the refinement tree as a root node with set of children nodes containing all initial classifiers
-
-