dice.tree.model
Class ClassificationModel

java.lang.Object
  extended by dice.tree.model.ClassificationModel

public class ClassificationModel
extends java.lang.Object

The Random Decision Trees Model for classification prediction. The usage can of it can be found in dice.examples package.

Version:
0.000
Author:
Xiatian Zhang

Field Summary
protected  int[] attrs
          The attribute type array.
protected  int clsSize
          The size of classes.
static double frac
          An parameter for claiming or reclaiming the space of the arrays may be used in Model
protected  int minS
          If the number of data instances in a leaf node is leass than minS, Model don't use that leaf node's class distribution to predict, while it will use the class distribution on the parent node to predict.
protected  java.util.Random rd
          Random number generator.
protected  Node[] trees
          The array stores the decision trees.
 
Constructor Summary
ClassificationModel()
           
 
Method Summary
 void clear()
           
 java.util.Map<java.lang.Integer,java.lang.Double> estimateProb(Instance inst)
          Predict the probabilities of classes of an instance.
protected  Node findLeaf(Node tree, Instance inst)
          Find the leaf node the given instance belong to.
protected  java.util.Map<java.lang.Integer,java.lang.Double> getChildrenDists(Node node)
          Get the distribution of an inner node.
 void init(Node[] trees, int[] attrs, int clsSize, int minS)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frac

public static double frac
An parameter for claiming or reclaiming the space of the arrays may be used in Model


trees

protected Node[] trees
The array stores the decision trees.


minS

protected int minS
If the number of data instances in a leaf node is leass than minS, Model don't use that leaf node's class distribution to predict, while it will use the class distribution on the parent node to predict.


attrs

protected int[] attrs
The attribute type array.


clsSize

protected int clsSize
The size of classes.


rd

protected java.util.Random rd
Random number generator.

Constructor Detail

ClassificationModel

public ClassificationModel()
Method Detail

init

public void init(Node[] trees,
                 int[] attrs,
                 int clsSize,
                 int minS)

clear

public void clear()

estimateProb

public java.util.Map<java.lang.Integer,java.lang.Double> estimateProb(Instance inst)
Predict the probabilities of classes of an instance.

Parameters:
inst -
Returns:

findLeaf

protected Node findLeaf(Node tree,
                        Instance inst)
Find the leaf node the given instance belong to.

Parameters:
tree -
inst -
Returns:

getChildrenDists

protected java.util.Map<java.lang.Integer,java.lang.Double> getChildrenDists(Node node)
Get the distribution of an inner node.

Parameters:
node -
Returns: