public class C45 extends Algorithm
correct, log, modelDataset, modelFileName, resultFileName, startTime, testCorrect, testDataset, testFileName, testOutputFileName, trainDataset, trainFileName, trainOutputFileName
Constructor and Description |
---|
C45(parseParameters paramFile)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
classificationForItemset(Itemset itemset)
Returns class probabilities for an itemset.
|
double |
evaluateItemset(Itemset itemset)
Function to evaluate the class which the itemset must have according to the classification of the tree.
|
void |
generateTree(MyDataset itemsets)
Generates the tree.
|
Tree |
getTree()
Returns the C4.5 tree
|
static int |
maxIndex(double[] doubles)
Returns index of maximum element in a given array of doubles.
|
void |
priorsProbabilities()
Sets the class prior probabilities.
|
java.lang.String |
toString()
Function to print the tree.
|
getHeader, getNextToken, initTokenizer
public C45(parseParameters paramFile) throws java.lang.Exception
paramFile
- The parameters file.java.lang.Exception
- If the algorithm cannot be executed.public void generateTree(MyDataset itemsets) throws java.lang.Exception
itemsets
- The dataset used to build the tree.java.lang.Exception
- If the tree cannot be built.public double evaluateItemset(Itemset itemset) throws java.lang.Exception
itemset
- The itemset to evaluate.java.lang.Exception
- If cannot compute the classification.public final double[] classificationForItemset(Itemset itemset) throws java.lang.Exception
itemset
- The itemset.java.lang.Exception
- If cannot compute the classification.public static int maxIndex(double[] doubles)
doubles
- The array of elements.public void priorsProbabilities() throws java.lang.Exception
java.lang.Exception
- If cannot compute the probabilities.public java.lang.String toString()
toString
in class java.lang.Object
public Tree getTree()