public class Hyperrectangle
extends java.lang.Object
Structure to store a hyperrectangle.
Constructor and Description |
---|
Hyperrectangle()
Constructor
|
Hyperrectangle(int atributos,
double[] example,
int numclase,
int numinstancia)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
adjustWeightFailure()
Adjust the weight of the hyperrectangle by a miss
|
void |
adjustWeightSuccess()
Adjust the weight of the hyperrectangle by a goal
|
void |
calculeVolume()
Calculates the area, volumn, ... of the hyperrectangle
|
double |
distance(double[] example,
double[] weightAtrib)
Calculates the distance between hyperrectangle and the example(parameter)
|
void |
generalizeExemplar(double[] example,
int num)
Adds a new example to the hyperrectangle
|
int |
getClassAttribute() |
int |
getDimensions() |
int[] |
getLowerAndUpperValues(int id)
Returns the positions of the minimum and maximum value of the attribute id in the hyperrectangle
|
double[] |
getLowerValues() |
int |
getNumExamples() |
double[] |
getUpperValues() |
double |
getVolume() |
double |
getWeight() |
void |
print()
Prints an instance
|
public Hyperrectangle()
Constructor
public Hyperrectangle(int atributos, double[] example, int numclase, int numinstancia)
Constructor
public void generalizeExemplar(double[] example, int num)
Adds a new example to the hyperrectangle
example
- the new example to addnum
- the position in the Training setpublic void adjustWeightSuccess()
Adjust the weight of the hyperrectangle by a goal
public void adjustWeightFailure()
Adjust the weight of the hyperrectangle by a miss
public double distance(double[] example, double[] weightAtrib)
Calculates the distance between hyperrectangle and the example(parameter)
example
- the instance to calculate the distanceweightAtrib
- a vector that contains the weight for each attributepublic void calculeVolume()
Calculates the area, volumn, ... of the hyperrectangle
public double getVolume()
public int getDimensions()
public double getWeight()
public int getClassAttribute()
public double[] getLowerValues()
public double[] getUpperValues()
public int getNumExamples()
public int[] getLowerAndUpperValues(int id)
Returns the positions of the minimum and maximum value of the attribute id in the hyperrectangle
id
- the number of the attributepublic void print()
Prints an instance