public class Complex
extends java.lang.Object
implements java.lang.Comparable
This class stores the set of Selectors
Constructor and Description |
---|
Complex()
Default Constructor for the complex
|
Complex(int nClass)
Constructor for the complex
|
Modifier and Type | Method and Description |
---|---|
void |
addNameAttributes(java.lang.String[] atributos)
Do a local copy of the name of the input variables
|
void |
addSelector(Selector s)
Add the selector to the list
|
void |
clear()
Leaves the list empty
|
int |
compareTo(java.lang.Object o)
Compare two objects of the Complex class
|
void |
computeLaplace()
Calculate the LaPlaces's value for a complex
|
int |
getClassAttribute()
Devuelve la clase que define el complejo
|
int |
getDimensions()
Returns the number of dimensions
|
int[] |
getDistribution()
Returns the distribution vector.
|
int |
getDistributionClass(int clase)
Returns the distribution value for the class given.
|
double |
getHeuristic()
Returns the heuristic value if the complex
|
int |
getNClases()
Returns the number of classes of the problem
|
Selector |
getSelector(int indice)
Returns the selector in a position given the complex
|
double |
getVolume()
Returns the volume value of the complex object.
|
double |
getWeight()
Returns the weight value of the complex object.
|
void |
incrementDistribution(int clase)
Increases by 1 the number of covered examples of the given class
|
boolean |
instanceCoveredByRule(Instance instance)
Checks if the rule gets the parameter instance
|
boolean |
isCovered(Sample m)
Check if the complex gets the given data
|
boolean |
isEqual(Complex c)
Check is two complex are equals
|
void |
print(int nominal)
Prints on the standard output the content of this complex object.
|
void |
printDistribution()
Prints on the screen the class distribution of the complex
|
java.lang.String |
printDistributionString()
Prints on the screen the class distribution for the complex
|
java.lang.String |
printString(int[] numValues)
Prints as a String the complex content (List->Attribute)
|
void |
removeDistribution()
Resets the classes distribution to 0.
|
void |
removeSelector(Selector s)
Remove the selector from the list
|
void |
removeSelectorAttribute(int attribute)
Remove the selectors from the list of the selectors that have the parameter attribute
o
|
void |
setClassAttribute(int clase)
Returns the class that defines the comples
|
void |
setDimensions(int d)
Sets the number of dimensions with the value given.
|
void |
setHeuristic(double heu)
Assign a heuristic value(Wracc) to the complex
|
void |
setVolume(double v)
Sets the volume with the value given.
|
void |
setWeight(double w)
Sets the weight with the value given.
|
int |
size()
Returns the size of the complex
|
public Complex()
Default Constructor for the complex
public Complex(int nClass)
Constructor for the complex
nClass
- int Number of classespublic int compareTo(java.lang.Object o)
Compare two objects of the Complex class
compareTo
in interface java.lang.Comparable
o
- Object Complex to comparepublic boolean isEqual(Complex c)
Check is two complex are equals
c
- complex to comparepublic void addSelector(Selector s)
Add the selector to the list
s
- Selector the selectorpublic void removeSelector(Selector s)
Remove the selector from the list
s
- Selector The selectorpublic void removeSelectorAttribute(int attribute)
Remove the selectors from the list of the selectors that have the parameter attribute
oattribute
- the attributepublic void clear()
Leaves the list empty
public Selector getSelector(int indice)
Returns the selector in a position given the complex
indice
- int Podition inside the complexpublic int size()
Returns the size of the complex
public int getNClases()
Returns the number of classes of the problem
public int getClassAttribute()
public void setClassAttribute(int clase)
Returns the class that defines the comples
public void setWeight(double w)
w
- given value to set.public double getWeight()
public void setVolume(double v)
v
- given value to set.public double getVolume()
public void setDimensions(int d)
d
- given value to set.public int getDimensions()
public void computeLaplace()
Calculate the LaPlaces's value for a complex
public boolean instanceCoveredByRule(Instance instance)
Checks if the rule gets the parameter instance
instance
- the instancepublic boolean isCovered(Sample m)
Check if the complex gets the given data
m
- Muestra The examplepublic double getHeuristic()
Returns the heuristic value if the complex
public void setHeuristic(double heu)
Assign a heuristic value(Wracc) to the complex
heu
- double the heuristic valuepublic void removeDistribution()
public void incrementDistribution(int clase)
clase
- given class.public int getDistributionClass(int clase)
clase
- int given class.public int[] getDistribution()
public void print(int nominal)
public java.lang.String printString(int[] numValues)
Prints as a String the complex content (List->Attribute)
public void printDistribution()
Prints on the screen the class distribution of the complex
public java.lang.String printDistributionString()
Prints on the screen the class distribution for the complex
public void addNameAttributes(java.lang.String[] atributos)
Do a local copy of the name of the input variables
atributos
- String[] an aray that stores the variable's name