Class NumericAttributeBinaryRulePredicate
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.classifiers.core.conditionaltests.InstanceConditionalTest
-
- moa.classifiers.core.conditionaltests.InstanceConditionalBinaryTest
-
- moa.classifiers.rules.core.conditionaltests.NumericAttributeBinaryRulePredicate
-
- All Implemented Interfaces:
Serializable
,Predicate
,MOAObject
public class NumericAttributeBinaryRulePredicate extends InstanceConditionalBinaryTest implements Predicate
Numeric binary conditional test for instances to use to split nodes in AMRules.- Version:
- $Revision: 1 $
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NumericAttributeBinaryRulePredicate(int attIndex, double attValue, int operator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
branchForInstance(Instance inst)
Returns the number of the branch for an instance, -1 if unknown.String
describeConditionForBranch(int branch, InstancesHeader context)
Gets the text that describes the condition of a branch.boolean
evaluate(Instance inst)
int
getAttributeIndex()
int[]
getAttsTestDependsOn()
Returns an array with the attributes that the test depends on.void
getDescription(StringBuilder sb, int indent)
Returns a string representation of this object.void
getDescription(StringBuilder sb, int indent, InstanceInformation instInformation)
double
getSplitValue()
boolean
isEqual(NumericAttributeBinaryRulePredicate predicate)
boolean
isEqualOrLess()
boolean
isIncludedInRuleNode(NumericAttributeBinaryRulePredicate predicate)
boolean
isUsingSameAttribute(NumericAttributeBinaryRulePredicate predicate)
void
negateCondition()
void
setAttributeValue(NumericAttributeBinaryRulePredicate ruleSplitNodeTest)
String
toString()
Returns a description of the object.-
Methods inherited from class moa.classifiers.core.conditionaltests.InstanceConditionalBinaryTest
maxBranches
-
Methods inherited from class moa.classifiers.core.conditionaltests.InstanceConditionalTest
resultKnownForInstance
-
Methods inherited from class moa.AbstractMOAObject
copy, copy, measureByteSize, measureByteSize
-
-
-
-
Method Detail
-
negateCondition
public void negateCondition()
- Specified by:
negateCondition
in interfacePredicate
-
branchForInstance
public int branchForInstance(Instance inst)
Description copied from class:InstanceConditionalTest
Returns the number of the branch for an instance, -1 if unknown.- Specified by:
branchForInstance
in classInstanceConditionalTest
- Parameters:
inst
- the instance to be used- Returns:
- the number of the branch for an instance, -1 if unknown.
-
describeConditionForBranch
public String describeConditionForBranch(int branch, InstancesHeader context)
Description copied from class:InstanceConditionalTest
Gets the text that describes the condition of a branch. It is used to describe the branch.- Specified by:
describeConditionForBranch
in classInstanceConditionalTest
- Parameters:
branch
- the number of the branch to describecontext
- the context or header of the data stream- Returns:
- the text that describes the condition of the branch
-
getAttsTestDependsOn
public int[] getAttsTestDependsOn()
Description copied from class:InstanceConditionalTest
Returns an array with the attributes that the test depends on.- Specified by:
getAttsTestDependsOn
in classInstanceConditionalTest
- Returns:
- an array with the attributes that the test depends on
-
getSplitValue
public double getSplitValue()
-
isEqual
public boolean isEqual(NumericAttributeBinaryRulePredicate predicate)
-
isUsingSameAttribute
public boolean isUsingSameAttribute(NumericAttributeBinaryRulePredicate predicate)
-
isIncludedInRuleNode
public boolean isIncludedInRuleNode(NumericAttributeBinaryRulePredicate predicate)
-
setAttributeValue
public void setAttributeValue(NumericAttributeBinaryRulePredicate ruleSplitNodeTest)
-
getDescription
public void getDescription(StringBuilder sb, int indent)
Description copied from interface:MOAObject
Returns a string representation of this object. Used inAbstractMOAObject.toString
to give a string representation of the object.- Specified by:
getDescription
in interfaceMOAObject
- Parameters:
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
getDescription
public void getDescription(StringBuilder sb, int indent, InstanceInformation instInformation)
- Specified by:
getDescription
in interfacePredicate
-
toString
public String toString()
Description copied from class:AbstractMOAObject
Returns a description of the object.- Overrides:
toString
in classAbstractMOAObject
- Returns:
- a description of the object
-
getAttributeIndex
public int getAttributeIndex()
- Specified by:
getAttributeIndex
in interfacePredicate
-
isEqualOrLess
public boolean isEqualOrLess()
- Specified by:
isEqualOrLess
in interfacePredicate
-
-