public class Nodo
extends java.lang.Object
Constructor and Description |
---|
Nodo()
Default constructor.
|
Nodo(boolean isLeaf,
myDataset train,
double prob1,
double prob2)
Paramenter constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
asignaPesos(double prob)
Sets weights to the attributes within a given probability.
|
Nodo |
copia()
Returns a copy of the node.
|
void |
copiar(Nodo copia)
Copies the given node.
|
boolean |
cubre(double[] ejemplo)
Checks if an example given is covered by the node.
|
boolean |
cubre(int posEjemplo)
Checks if an example with the given index is covered by the node.
|
void |
nuevo(double prob1,
double prob2)
Constructs a new node by spitting the set with the probability given.
|
java.lang.String |
printString()
Returns a String representation of the node.
|
void |
splitSet(int atributo,
double prob1,
double prob2)
Splits the node with the given attribute randomly with the given probabilities.
|
public Nodo()
public Nodo(boolean isLeaf, myDataset train, double prob1, double prob2)
isLeaf
- Leaf identifier. (true if the node is a leaf).train
- training dataset.prob1
- first probability used to split the node.prob2
- second probability used to split the node.public void nuevo(double prob1, double prob2)
prob1
- first probability used to split the node.prob2
- second probability used to split the node.public void splitSet(int atributo, double prob1, double prob2)
atributo
- attribute used to split the node.prob1
- first probability used to split the node.prob2
- second probability used to split the node.public void asignaPesos(double prob)
prob
- given probability.public Nodo copia()
public java.lang.String printString()
public boolean cubre(int posEjemplo)
posEjemplo
- given example index.public boolean cubre(double[] ejemplo)
ejemplo
- given example.public void copiar(Nodo copia)
copia
- given node.