public class Tree
extends java.lang.Object
Title: Tree.
Description: This class implements the decision tree
Modifier and Type | Field and Description |
---|---|
static int[][] |
ejemplos
Number of examples for each leaf/class
|
static int |
maxNodos
Maximum number of nodes allowed.
|
static int |
nodos
Number of Leafs in the tree
|
static int |
nodosT
Number of Leafs in the tree
|
Constructor and Description |
---|
Tree()
Default Constructor.
|
Tree(Tree pae,
myDataset train,
int n_ejemplos,
int[] ejemplos,
int nGenerations)
Paramenter constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
clasificar(double[] ejemplo)
Classifies a given example, returning the predicted class.
|
Tree |
copia(Tree padre)
Returns a copy of the tree with the given father set.
|
java.lang.String |
printString()
Returns a String representation of the tree.
|
public static int nodosT
public static int nodos
public static int maxNodos
public static int[][] ejemplos
public Tree()
public Tree(Tree pae, myDataset train, int n_ejemplos, int[] ejemplos, int nGenerations)
pae
- Father Tree.train
- Training dataset.n_ejemplos
- Number of examples in this tree.ejemplos
- Examples in this tree.nGenerations
- Number of generations.public Tree copia(Tree padre)
padre
- father to be set to the copy.public java.lang.String printString()
public java.lang.String clasificar(double[] ejemplo)
ejemplo
- given example.