Package weka.associations
Class Tertius
- java.lang.Object
-
- weka.associations.AbstractAssociator
-
- weka.associations.Tertius
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Runnable,Associator,CapabilitiesHandler,OptionHandler,RevisionHandler,TechnicalInformationHandler
public class Tertius extends AbstractAssociator implements OptionHandler, java.lang.Runnable, TechnicalInformationHandler
Finds rules according to confirmation measure (Tertius-type algorithm).
For more information see:
P. A. Flach, N. Lachiche (1999). Confirmation-Guided Discovery of first-order rules with Tertius. Machine Learning. 42:61-95. BibTeX:@article{Flach1999, author = {P. A. Flach and N. Lachiche}, journal = {Machine Learning}, pages = {61-95}, title = {Confirmation-Guided Discovery of first-order rules with Tertius}, volume = {42}, year = {1999} }Valid options are:-K <number of values in result> Set maximum number of confirmation values in the result. (default: 10)
-F <frequency threshold> Set frequency threshold for pruning. (default: 0)
-C <confirmation threshold> Set confirmation threshold. (default: 0)
-N <noise threshold> Set noise threshold : maximum frequency of counter-examples. 0 gives only satisfied rules. (default: 1)
-R Allow attributes to be repeated in a same rule.
-L <number of literals> Set maximum number of literals in a rule. (default: 4)
-G <0=no negation | 1=body | 2=head | 3=body and head> Set the negations in the rule. (default: 0)
-S Consider only classification rules.
-c <class index> Set index of class attribute. (default: last).
-H Consider only horn clauses.
-E Keep equivalent rules.
-M Keep same clauses.
-T Keep subsumed rules.
-I <0=always match | 1=never match | 2=significant> Set the way to handle missing values. (default: 0)
-O Use ROC analysis.
-p <name of file> Set the file containing the parts of the individual for individual-based learning.
-P <0=no output | 1=on stdout | 2=in separate window> Set output of current values. (default: 0)
- Version:
- $Revision: 6368 $
- Author:
- Amelie Deltour
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intEXPLICITWay of handling missing values: min counterinstancesstatic intIMPLICITWay of handling missing values: max counterinstancesstatic intSIGNIFICANTWay of handling missing values: missing as a particular value
-
Constructor Summary
Constructors Constructor Description Tertius()Constructor that sets the options to the default values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildAssociations(Instances instances)Method that launches the search to find the rules with the highest confirmation.java.lang.StringclassificationTipText()Returns the tip text for this property.java.lang.StringclassIndexTipText()Returns the tip text for this property.java.lang.StringconfirmationThresholdTipText()Returns the tip text for this property.java.lang.StringconfirmationValuesTipText()Returns the tip text for this property.booleandisabled_getEquivalent()Get the value of equivalent.java.io.Filedisabled_getPartFile()Get the value of partFile.booleandisabled_getSameClause()Get the value of sameClause.booleandisabled_getSubsumption()Get the value of subsumption.voiddisabled_setEquivalent(boolean v)Set the value of equivalent.voiddisabled_setPartFile(java.io.File v)Set the value of partFile.voiddisabled_setSameClause(boolean v)Set the value of sameClause.voiddisabled_setSubsumption(boolean v)Set the value of subsumption.java.lang.StringequivalentTipText()Returns the tip text for this property.java.lang.StringfrequencyThresholdTipText()Returns the tip text for this property.CapabilitiesgetCapabilities()Returns default capabilities of the classifier.booleangetClassification()Get the value of classification.intgetClassIndex()Get the value of classIndex.doublegetConfirmationThreshold()Get the value of confirmationThreshold.intgetConfirmationValues()Get the value of confirmationValues.doublegetFrequencyThreshold()Get the value of frequencyThreshold.booleangetHornClauses()Get the value of hornClauses.SelectedTaggetMissingValues()Get the value of missingValues.SelectedTaggetNegation()Get the value of negation.doublegetNoiseThreshold()Get the value of noiseThreshold.intgetNumberLiterals()Get the value of numberLiterals.java.lang.String[]getOptions()Gets the current settings of the Tertius object.booleangetRepeatLiterals()Get the value of repeatLiterals.SimpleLinkedListgetResults()returns the resultsjava.lang.StringgetRevision()Returns the revision string.booleangetRocAnalysis()Get the value of rocAnalysis.TechnicalInformationgetTechnicalInformation()Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.SelectedTaggetValuesOutput()Get the value of valuesOutput.java.lang.StringglobalInfo()Returns a string describing this associator.java.lang.StringhornClausesTipText()Returns the tip text for this property.java.util.EnumerationlistOptions()Returns an enumeration describing the available options.static voidmain(java.lang.String[] args)Main method.java.lang.StringmissingValuesTipText()Returns the tip text for this property.java.lang.StringnegationTipText()Returns the tip text for this property.java.lang.StringnoiseThresholdTipText()Returns the tip text for this property.java.lang.StringnumberLiteralsTipText()Returns the tip text for this property.java.lang.StringpartFileTipText()Returns the tip text for this property.java.lang.StringrepeatLiteralsTipText()Returns the tip text for this property.voidresetOptions()Resets the options to the default values.java.lang.StringrocAnalysisTipText()Returns the tip text for this property.voidrun()Run the search.java.lang.StringsameClauseTipText()Returns the tip text for this property.voidsearch()Search in the space of hypotheses the rules that have the highest confirmation.voidsetClassification(boolean v)Set the value of classification.voidsetClassIndex(int v)Set the value of classIndex.voidsetConfirmationThreshold(double v)Set the value of confirmationThreshold.voidsetConfirmationValues(int v)Set the value of confirmationValues.voidsetFrequencyThreshold(double v)Set the value of frequencyThreshold.voidsetHornClauses(boolean v)Set the value of hornClauses.voidsetMissingValues(SelectedTag v)Set the value of missingValues.voidsetNegation(SelectedTag v)Set the value of negation.voidsetNoiseThreshold(double v)Set the value of noiseThreshold.voidsetNumberLiterals(int v)Set the value of numberLiterals.voidsetOptions(java.lang.String[] options)Parses a given list of options.voidsetRepeatLiterals(boolean v)Set the value of repeatLiterals.voidsetRocAnalysis(boolean v)Set the value of rocAnalysis.voidsetValuesOutput(SelectedTag v)Set the value of valuesOutput.java.lang.StringsubsumptionTipText()Returns the tip text for this property.java.lang.StringtoString()Outputs the best rules found with their confirmation value and number of counter-instances.java.lang.StringvaluesOutputTipText()Returns the tip text for this property.-
Methods inherited from class weka.associations.AbstractAssociator
forName, makeCopies, makeCopy
-
-
-
-
Field Detail
-
EXPLICIT
public static final int EXPLICIT
Way of handling missing values: min counterinstances- See Also:
- Constant Field Values
-
IMPLICIT
public static final int IMPLICIT
Way of handling missing values: max counterinstances- See Also:
- Constant Field Values
-
SIGNIFICANT
public static final int SIGNIFICANT
Way of handling missing values: missing as a particular value- See Also:
- Constant Field Values
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns a string describing this associator.- Returns:
- A description of the evaluator suitable for displaying in the explorer/experimenter gui.
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
resetOptions
public void resetOptions()
Resets the options to the default values.
-
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Returns:
- An enumeration of all the available options.
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.ExceptionParses a given list of options. Valid options are:-K <number of values in result> Set maximum number of confirmation values in the result. (default: 10)
-F <frequency threshold> Set frequency threshold for pruning. (default: 0)
-C <confirmation threshold> Set confirmation threshold. (default: 0)
-N <noise threshold> Set noise threshold : maximum frequency of counter-examples. 0 gives only satisfied rules. (default: 1)
-R Allow attributes to be repeated in a same rule.
-L <number of literals> Set maximum number of literals in a rule. (default: 4)
-G <0=no negation | 1=body | 2=head | 3=body and head> Set the negations in the rule. (default: 0)
-S Consider only classification rules.
-c <class index> Set index of class attribute. (default: last).
-H Consider only horn clauses.
-E Keep equivalent rules.
-M Keep same clauses.
-T Keep subsumed rules.
-I <0=always match | 1=never match | 2=significant> Set the way to handle missing values. (default: 0)
-O Use ROC analysis.
-p <name of file> Set the file containing the parts of the individual for individual-based learning.
-P <0=no output | 1=on stdout | 2=in separate window> Set output of current values. (default: 0)
- Specified by:
setOptionsin interfaceOptionHandler- Parameters:
options- The list of options as an array of strings.- Throws:
java.lang.Exception- if an option is not supported.
-
getOptions
public java.lang.String[] getOptions()
Gets the current settings of the Tertius object.- Specified by:
getOptionsin interfaceOptionHandler- Returns:
- An array of strings suitable for passing to setOptions.
-
confirmationValuesTipText
public java.lang.String confirmationValuesTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getConfirmationValues
public int getConfirmationValues()
Get the value of confirmationValues.- Returns:
- Value of confirmationValues.
-
setConfirmationValues
public void setConfirmationValues(int v)
Set the value of confirmationValues.- Parameters:
v- Value to assign to confirmationValues.
-
frequencyThresholdTipText
public java.lang.String frequencyThresholdTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getFrequencyThreshold
public double getFrequencyThreshold()
Get the value of frequencyThreshold.- Returns:
- Value of frequencyThreshold.
-
setFrequencyThreshold
public void setFrequencyThreshold(double v)
Set the value of frequencyThreshold.- Parameters:
v- Value to assign to frequencyThreshold.
-
confirmationThresholdTipText
public java.lang.String confirmationThresholdTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getConfirmationThreshold
public double getConfirmationThreshold()
Get the value of confirmationThreshold.- Returns:
- Value of confirmationThreshold.
-
setConfirmationThreshold
public void setConfirmationThreshold(double v)
Set the value of confirmationThreshold.- Parameters:
v- Value to assign to confirmationThreshold.
-
noiseThresholdTipText
public java.lang.String noiseThresholdTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getNoiseThreshold
public double getNoiseThreshold()
Get the value of noiseThreshold.- Returns:
- Value of noiseThreshold.
-
setNoiseThreshold
public void setNoiseThreshold(double v)
Set the value of noiseThreshold.- Parameters:
v- Value to assign to noiseThreshold.
-
repeatLiteralsTipText
public java.lang.String repeatLiteralsTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getRepeatLiterals
public boolean getRepeatLiterals()
Get the value of repeatLiterals.- Returns:
- Value of repeatLiterals.
-
setRepeatLiterals
public void setRepeatLiterals(boolean v)
Set the value of repeatLiterals.- Parameters:
v- Value to assign to repeatLiterals.
-
numberLiteralsTipText
public java.lang.String numberLiteralsTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getNumberLiterals
public int getNumberLiterals()
Get the value of numberLiterals.- Returns:
- Value of numberLiterals.
-
setNumberLiterals
public void setNumberLiterals(int v)
Set the value of numberLiterals.- Parameters:
v- Value to assign to numberLiterals.
-
negationTipText
public java.lang.String negationTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getNegation
public SelectedTag getNegation()
Get the value of negation.- Returns:
- Value of negation.
-
setNegation
public void setNegation(SelectedTag v)
Set the value of negation.- Parameters:
v- Value to assign to negation.
-
classificationTipText
public java.lang.String classificationTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getClassification
public boolean getClassification()
Get the value of classification.- Returns:
- Value of classification.
-
setClassification
public void setClassification(boolean v)
Set the value of classification.- Parameters:
v- Value to assign to classification.
-
classIndexTipText
public java.lang.String classIndexTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getClassIndex
public int getClassIndex()
Get the value of classIndex.- Returns:
- Value of classIndex.
-
setClassIndex
public void setClassIndex(int v)
Set the value of classIndex.- Parameters:
v- Value to assign to classIndex.
-
hornClausesTipText
public java.lang.String hornClausesTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getHornClauses
public boolean getHornClauses()
Get the value of hornClauses.- Returns:
- Value of hornClauses.
-
setHornClauses
public void setHornClauses(boolean v)
Set the value of hornClauses.- Parameters:
v- Value to assign to hornClauses.
-
equivalentTipText
public java.lang.String equivalentTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
disabled_getEquivalent
public boolean disabled_getEquivalent()
Get the value of equivalent.- Returns:
- Value of equivalent.
-
disabled_setEquivalent
public void disabled_setEquivalent(boolean v)
Set the value of equivalent.- Parameters:
v- Value to assign to equivalent.
-
sameClauseTipText
public java.lang.String sameClauseTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
disabled_getSameClause
public boolean disabled_getSameClause()
Get the value of sameClause.- Returns:
- Value of sameClause.
-
disabled_setSameClause
public void disabled_setSameClause(boolean v)
Set the value of sameClause.- Parameters:
v- Value to assign to sameClause.
-
subsumptionTipText
public java.lang.String subsumptionTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
disabled_getSubsumption
public boolean disabled_getSubsumption()
Get the value of subsumption.- Returns:
- Value of subsumption.
-
disabled_setSubsumption
public void disabled_setSubsumption(boolean v)
Set the value of subsumption.- Parameters:
v- Value to assign to subsumption.
-
missingValuesTipText
public java.lang.String missingValuesTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getMissingValues
public SelectedTag getMissingValues()
Get the value of missingValues.- Returns:
- Value of missingValues.
-
setMissingValues
public void setMissingValues(SelectedTag v)
Set the value of missingValues.- Parameters:
v- Value to assign to missingValues.
-
rocAnalysisTipText
public java.lang.String rocAnalysisTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getRocAnalysis
public boolean getRocAnalysis()
Get the value of rocAnalysis.- Returns:
- Value of rocAnalysis.
-
setRocAnalysis
public void setRocAnalysis(boolean v)
Set the value of rocAnalysis.- Parameters:
v- Value to assign to rocAnalysis.
-
partFileTipText
public java.lang.String partFileTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
disabled_getPartFile
public java.io.File disabled_getPartFile()
Get the value of partFile.- Returns:
- Value of partFile.
-
disabled_setPartFile
public void disabled_setPartFile(java.io.File v) throws java.lang.ExceptionSet the value of partFile.- Parameters:
v- Value to assign to partFile.- Throws:
java.lang.Exception- if file cannot be opened
-
valuesOutputTipText
public java.lang.String valuesOutputTipText()
Returns the tip text for this property.- Returns:
- Tip text for this property suitable for displaying in the explorer/experimenter GUI.
-
getValuesOutput
public SelectedTag getValuesOutput()
Get the value of valuesOutput.- Returns:
- Value of valuesOutput.
-
setValuesOutput
public void setValuesOutput(SelectedTag v)
Set the value of valuesOutput.- Parameters:
v- Value to assign to valuesOutput.
-
getCapabilities
public Capabilities getCapabilities()
Returns default capabilities of the classifier.- Specified by:
getCapabilitiesin interfaceAssociator- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classAbstractAssociator- Returns:
- the capabilities of this classifier
- See Also:
Capabilities
-
buildAssociations
public void buildAssociations(Instances instances) throws java.lang.Exception
Method that launches the search to find the rules with the highest confirmation.- Specified by:
buildAssociationsin interfaceAssociator- Parameters:
instances- The instances to be used for generating the rules.- Throws:
java.lang.Exception- if rules can't be built successfully.
-
run
public void run()
Run the search.- Specified by:
runin interfacejava.lang.Runnable
-
search
public void search()
Search in the space of hypotheses the rules that have the highest confirmation. The search starts with the empty rule, other rules are generated by refinement.
-
getResults
public SimpleLinkedList getResults()
returns the results- Returns:
- the results
-
toString
public java.lang.String toString()
Outputs the best rules found with their confirmation value and number of counter-instances. Also gives the number of hypotheses considered and explored, and the time needed.- Overrides:
toStringin classjava.lang.Object
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classAbstractAssociator- Returns:
- the revision
-
main
public static void main(java.lang.String[] args)
Main method.- Parameters:
args- the commandline parameters
-
-