net.sf.myra.antree.representation
Class Statistics

java.lang.Object
  extended by net.sf.myra.antree.representation.Statistics

public class Statistics
extends java.lang.Object

Version:
$Revision: 2331 $ $Date:: 2011-08-06 22:23:05#$
Author:
Fernando Esteban Barril Otero

Constructor Summary
Statistics(net.sf.myra.datamining.data.Metadata metadata)
          Default constructor.
 
Method Summary
 double[] getDistribution(Node node)
          Returns the class distribution of the specified node.
 double getErrors(Node node, net.sf.myra.datamining.data.Label prediction)
          Returns the error rate at the specified node given a prediction.
 net.sf.myra.datamining.data.Label getMajority()
          Returns the majority class label.
 net.sf.myra.datamining.data.Label getMajorityLabel(Node node)
          Returns the majority class label for the specified node.
 double getTotal(Node node)
          Returns the total number of instances reaching the specified node.
 void setDistribution(Node node, double[] distribution)
          Sets the class distribution of the specified node.
 void setMajority(net.sf.myra.datamining.data.Label majority)
          Sets the majority class label.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Statistics

public Statistics(net.sf.myra.datamining.data.Metadata metadata)
Default constructor.

Parameters:
metadata - the current data set metadata.
Method Detail

getDistribution

public double[] getDistribution(Node node)
Returns the class distribution of the specified node.

Parameters:
node - the node reference.
Returns:
the class distribution of the specified node.

setDistribution

public void setDistribution(Node node,
                            double[] distribution)
Sets the class distribution of the specified node.

Parameters:
node - the node reference.
distribution - the distribution to set.

getMajority

public net.sf.myra.datamining.data.Label getMajority()
Returns the majority class label.

Returns:
the majority class label.

setMajority

public void setMajority(net.sf.myra.datamining.data.Label majority)
Sets the majority class label.

Parameters:
majority - the majority class label to set.

getTotal

public double getTotal(Node node)
Returns the total number of instances reaching the specified node.

Parameters:
node - the node reference.
Returns:
the total number of instances reaching the specified node.

getMajorityLabel

public net.sf.myra.datamining.data.Label getMajorityLabel(Node node)
Returns the majority class label for the specified node. Note: this method should only be used for flat single-label problems.

Parameters:
node - the node reference.
Returns:
the majority class label for the specified node.

getErrors

public double getErrors(Node node,
                        net.sf.myra.datamining.data.Label prediction)
Returns the error rate at the specified node given a prediction.

Parameters:
node - the node reference.
prediction - the prediction at the node.
Returns:
the error rate at the specified node given a prediction.


Copyright © 2013. All Rights Reserved.