Class SimilarityTrainer
java.lang.Object
com.semedy.reasoner.api.induction.SimilarityTrainer
Adapts similarity built-ins to cover max positives and min negatives
- Author:
- angele
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
get the number of negatives covered by recently trained rulesint
get the number of positive covered by recently trained rulesvoid
trainRules
(Collection<String> ruleNames, String query4Positives, String query4Negatives, int stepRate) adapt similarity built-ins in rules to cover max positives and min negatives.
-
Constructor Details
-
SimilarityTrainer
- Throws:
IOException
SemReasonerException
-
-
Method Details
-
numberOfPositives
public int numberOfPositives()get the number of positive covered by recently trained rules- Returns:
-
numberOfNegatives
public int numberOfNegatives()get the number of negatives covered by recently trained rules- Returns:
-
trainRules
public void trainRules(Collection<String> ruleNames, String query4Positives, String query4Negatives, int stepRate) throws IOException, SemReasonerException, InterruptedException adapt similarity built-ins in rules to cover max positives and min negatives.
Query query4Positives queries the positive covered facts.
Query query4Negatives queries the negative covered facts.
Step rate defines the stepping for the similarity measure.
The rules mentioned in ruleNames are modified- Parameters:
ruleNames
- , the names of the rules to adaptquery4Positives
- , a query to retrieve all positives, could be nullquery4Negatives
- , a query to retrieve all negativses, could be nullstepRate
- , the step rate for the similarity measure from 0 to 10- Throws:
InterruptedException
SemReasonerException
IOException
-