public class Complex
extends java.lang.Object
implements java.lang.Comparable
Title: Complex
Description: Structure to represent a complex of one rule
Constructor and Description |
---|
Complex()
Builder.
|
Complex(int nClas)
Builder
|
Complex(int atr,
int op,
double val)
Builder.
|
Complex(Selector sel,
int nClas)
Complete builder.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeNames(java.lang.String[] atributos)
It performs a local copy of the name of the input variables
|
void |
addClassDistribution(int i)
Increments the class distribution
|
void |
addSelector(Selector sel)
Id adds the selector if it is not in the list
|
boolean |
almostSame(Complex c)
It checks if a complex is almost the same to another
|
int |
compareTo(java.lang.Object o)
Comparison function between two objects of the class complex
|
void |
computeLaplacian()
It computes the Laplacian value for the complex
|
Complex |
copyRule()
It copies the complex
|
boolean |
covered(Instance m)
It checks if the complex covers a given example
|
void |
deleteDistribution()
It resets the distribution value for the complex
|
int |
getClas()
It return the class id
|
int |
getClassDistribution(int i)
It returns the class distribution of a specified class
|
int[] |
getDistribution()
It returns the class distribution
|
double |
getheuristic()
It returns the heuristic of the complex (LEF function)
|
double |
getHeuristic()
Returns the heuristic value of the Complex.
|
int |
getNclasses()
It returns the number of classes
|
Selector |
getSelector(int i)
It returns one of the selectors associated to the complex
|
int |
getSize()
It returns the number of selectors of the complex
|
void |
print()
It prints the complex content
|
void |
printDistribution()
It prints the class distribution
|
java.lang.String |
printDistributionString()
It prints the class distribution on a string
|
java.lang.String |
printString()
It prints on a string the content of the complex
|
boolean |
same(Complex c)
It checks if a complex is equal to another.
|
boolean |
sameDistribution(Complex c)
It checks if two complexes have the same class distribution
|
void |
setClass(int i)
It assigns a class to the complex
|
void |
setDistribution(int[] dis)
It assigns a class distribution
|
void |
setheuristic(double heuristic)
It assigns the heuristic of the complex computed as:
Covered positives - covered negatives / number of selectors |
void |
setHeuristic(double heu)
Sets the heuristic value (Wracc) of this Complex object.
|
int |
size()
It returns the number of selectors of the complex
|
public Complex()
public Complex(int nClas)
nClas
- int Number of classespublic Complex(Selector sel, int nClas)
sel
- SelectornClas
- Number of classespublic Complex(int atr, int op, double val)
atr
- Id of the input attributeop
- operator code (higher or equal, distinct...)val
- Attribute valuepublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- "complex" object to comparepublic boolean same(Complex c)
c
- Complex to comparepublic boolean almostSame(Complex c)
c
- Complex to comparepublic boolean sameDistribution(Complex c)
c
- Complex to comparepublic void addClassDistribution(int i)
i
- Class idpublic void addSelector(Selector sel)
sel
- The selector to add [attr op value]public Selector getSelector(int i)
i
- Selector indexpublic int size()
public void print()
public java.lang.String printString()
public int[] getDistribution()
public int getClassDistribution(int i)
i
- clas idpublic void deleteDistribution()
public void printDistribution()
public java.lang.String printDistributionString()
public int getClas()
public void setClass(int i)
i
- the class idpublic Complex copyRule()
public void computeLaplacian()
public double getHeuristic()
public void setHeuristic(double heu)
heu
- double given value to be set.public boolean covered(Instance m)
m
- The examplepublic void setDistribution(int[] dis)
dis
- the given class distributionpublic int getNclasses()
public double getheuristic()
public void setheuristic(double heuristic)
heuristic
- The heuristicpublic int getSize()
public void addAttributeNames(java.lang.String[] atributos)
atributos
- String[] an Array that stores the name of each variable