|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.trees.lmt.LogisticBase
weka.classifiers.trees.ft.FTtree
public abstract class FTtree
Abstract class for Functional tree structure.
Constructor Summary | |
---|---|
FTtree()
|
Method Summary | |
---|---|
int |
assignIDs(int lastID)
Assigns unique IDs to all nodes in the tree |
int |
assignLeafModelNumbers(int leafCounter)
Assigns numbers to the logistic regression models at the leaves of the tree |
abstract void |
buildClassifier(Instances data)
Method for building a Functional Tree (only called for the root node). |
abstract void |
buildTree(Instances data,
SimpleLinearRegression[][] higherRegressions,
double totalInstanceWeight,
double higherNumParameters)
Abstract method for building the tree structure. |
void |
cleanup()
Cleanup in order to save memory. |
abstract double[] |
distributionForInstance(Instance instance)
Returns the class probabilities for an instance given by the Functional tree. |
int |
getConstError(double[] probsConst)
|
java.lang.String |
getModelParameters()
Returns a string describing the number of LogitBoost iterations performed at this node, the total number of LogitBoost iterations performed (including iterations at higher levels in the tree), and the number of training examples at this node. |
java.util.Vector |
getNodes()
Return a list of all inner nodes in the tree |
void |
getNodes(java.util.Vector nodeList)
Fills a list with all inner nodes in the tree |
int |
getNumInnerNodes()
Method to count the number of inner nodes in the tree |
int |
getNumLeaves()
Returns the number of leaves in the tree. |
java.lang.String |
getRevision()
Returns the revision string. |
java.lang.String |
graph()
Returns graph describing the tree. |
boolean |
hasModels()
Returns true if the logistic regression model at this node has changed compared to the one at the parent node. |
double[] |
modelDistributionForInstance(Instance instance)
Returns the class probabilities for an instance according to the logistic model at the node. |
java.lang.String |
modelsToString()
Returns a string describing the logistic regression function at the node. |
int |
numLeaves()
Returns the number of leaves (normal count). |
int |
numNodes()
Returns the number of nodes. |
abstract double |
prune()
Abstract Method that prunes a tree using C4.5 pruning procedure. |
java.lang.String |
toString()
Returns a description of the Functional tree (tree structure and logistic models) |
Methods inherited from class weka.classifiers.trees.lmt.LogisticBase |
---|
getMaxIterations, getNumRegressions, getUseAIC, getUsedAttributes, getWeightTrimBeta, percentAttributesUsed, setHeuristicStop, setMaxIterations, setUseAIC, setWeightTrimBeta |
Methods inherited from class weka.classifiers.Classifier |
---|
classifyInstance, debugTipText, forName, getCapabilities, getDebug, getOptions, listOptions, makeCopies, makeCopy, setDebug, setOptions |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FTtree()
Method Detail |
---|
public abstract void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class LogisticBase
data
- the data to train with
java.lang.Exception
- if something goes wrongpublic abstract void buildTree(Instances data, SimpleLinearRegression[][] higherRegressions, double totalInstanceWeight, double higherNumParameters) throws java.lang.Exception
data
- the training data passed on to this nodehigherRegressions
- An array of regression functions produced by LogitBoost at higher
levels in the tree. They represent a logistic regression model that is refined locally
at this node.totalInstanceWeight
- the total number of training exampleshigherNumParameters
- effective number of parameters in the logistic regression model built
in parent nodes
java.lang.Exception
- if something goes wrongpublic abstract double prune() throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic int getNumInnerNodes()
public int getNumLeaves()
public java.util.Vector getNodes()
public void getNodes(java.util.Vector nodeList)
nodeList
- the list to be filledpublic int getConstError(double[] probsConst)
any
- probsConstpublic boolean hasModels()
public double[] modelDistributionForInstance(Instance instance) throws java.lang.Exception
instance
- the instance
java.lang.Exception
public abstract double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class LogisticBase
instance
- the instance
java.lang.Exception
- if distribution can't be computed successfullypublic java.lang.String toString()
toString
in class LogisticBase
public int numLeaves()
public int numNodes()
public java.lang.String getModelParameters()
public int assignIDs(int lastID)
public int assignLeafModelNumbers(int leafCounter)
public java.lang.String modelsToString()
public java.lang.String graph() throws java.lang.Exception
java.lang.Exception
- if something goes wrongpublic void cleanup()
cleanup
in class LogisticBase
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class LogisticBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |