public class Rule
extends java.lang.Object
Constructor and Description |
---|
Rule()
Default builder.
|
Rule(double[] instance,
int out)
Builder.
|
Modifier and Type | Method and Description |
---|---|
Rule |
clone()
Clone method
|
double |
distance(double[] instance)
Computes the distance between a given instance and the rule.
|
boolean |
equals(java.lang.Object rul)
Equals method
|
double |
getLaplaceAcc()
Returns the Laplace accuracy of the rule
|
int |
getOutput()
Returns the output class of the rule
|
boolean |
inside(double[] instance)
Tests if an instance is covered by the rule
|
void |
loadRule(double[] instance,
int out)
Reinitialices a rule, loading it with the contents of a single instance
|
static void |
loadSVDMmatrix(double[][] instances,
int[] outputs)
Computes the SVDM distance matrix
|
void |
mostSpecificGeneralization(double[] instance)
Performs the most specific possible generalization over the rule to cover
a new instance
|
static void |
setAttributes(Attribute[] inputs)
Test which attributes are nominal
|
void |
setLaplaceAcc(double acc)
Sets the Laplace accuracy of the rule
|
static void |
setNClasses(int value)
Sets the number of classes
|
static void |
setNumValue(int value,
int pos)
Sets the number of different values for an attribute
|
static void |
setQ(int value)
Sets the Q parameter
|
static void |
setS(int value)
Sets the S parameter
|
static void |
setSize(int value)
Sets the size of the rule
|
java.lang.String |
toString()
To String method
|
public Rule()
public Rule(double[] instance, int out)
instance
- Basic instanceout
- Ouput of the instancepublic static void setSize(int value)
value
- Number of attributes of the rulepublic static void setQ(int value)
value
- Value of the Q parameterpublic static void setS(int value)
value
- Value of the S parameterpublic static void setAttributes(Attribute[] inputs)
inputs
- Attributes' descriptionspublic static void setNClasses(int value)
value
- Number of classespublic static void setNumValue(int value, int pos)
value
- Number of valuespos
- Index of the attributepublic void setLaplaceAcc(double acc)
acc
- Accuracy of the rulepublic int getOutput()
public double getLaplaceAcc()
public static void loadSVDMmatrix(double[][] instances, int[] outputs)
instances
- Instances of the data setoutputs
- Output attribute of the instancespublic void loadRule(double[] instance, int out)
instance
- Basic instanceout
- Ouput of the instancepublic boolean inside(double[] instance)
instance
- Instance to be testedpublic void mostSpecificGeneralization(double[] instance)
instance
- Instance to be coveredpublic Rule clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object rul)
equals
in class java.lang.Object
rul
- Another rulepublic java.lang.String toString()
toString
in class java.lang.Object
public double distance(double[] instance)
instance
- Instance to be tested