public class FunctionalTrees
extends java.lang.Object
Constructor and Description |
---|
FunctionalTrees(java.lang.String script)
Creates a FunctionalTrees instance by reading the script file that contains all the
information needed for running the algorithm
|
Modifier and Type | Method and Description |
---|---|
int |
evaluateItem(double[] item)
Classifies a given item with the information stored in the tree
|
void |
execute()
This method performs the classification for all the instances: the train and the test sets
|
void |
growTree(TreeNode node)
Builds the tree from a tree node that functions as a root node, with all the data stored in
the class
|
void |
print(myDataset data,
java.lang.String filename,
int type)
Prints in a file the result of the classification made with the tree generated by the PUBLIC
algorithm.
|
void |
printResults(myDataset data,
java.lang.String filename)
Prints in a file the result of the classification made with the tree generated by the PUBLIC
algorithm, this means, the tree itself and the general information about it
|
void |
pruneTree()
Prunes the tree accordingly to the prune criteria, this means, makes some of the non-leaf nodes
as leaves and deletes its descendants
|
protected void |
readConfiguration(java.lang.String script)
Reads configuration script, and extracts its contents.
|
protected void |
readParameters(java.lang.String script)
Reads configuration script, to extract the parameter's values.
|
public FunctionalTrees(java.lang.String script)
script
- The configuration script which contains the parameters of the algorithmpublic void growTree(TreeNode node)
node
- Tree node that is considered as a root node from which we are generating descendant
nodespublic void pruneTree()
public void execute()
protected void readConfiguration(java.lang.String script)
script
- Name of the configuration scriptprotected void readParameters(java.lang.String script)
script
- Name of the configuration scriptpublic int evaluateItem(double[] item)
item
- Data attribute values for the item we are classifyingpublic void print(myDataset data, java.lang.String filename, int type)
data
- Dataset that we are classifyingfilename
- Name of the file that is going to store the resultstype
- 0 if we are working with a train set, 1 if we are working with a test setpublic void printResults(myDataset data, java.lang.String filename)
data
- Dataset that we are working withfilename
- Name of the file that is going to store the results