org.knime.base.node.mine.decisiontree2.learner
Class NominalValueHistogram

java.lang.Object
  extended by org.knime.base.node.mine.decisiontree2.learner.NominalValueHistogram

public class NominalValueHistogram
extends Object

Represents a count histogram for nominal values. It counts the class values for each nominal value. This histogram has all information to calculate the information quality, either for normal nominal splits as well as for binary nominal subset splits.

Author:
Christoph Sieb, University of Konstanz

Constructor Summary
NominalValueHistogram()
          Creates a nominal value histogram.
NominalValueHistogram(NominalValueHistogram template)
          Creates a nominal value histogram from the given template.
 
Method Summary
 double[][] getHistogram()
          Returns the count histogram.
 double getMissingValueCount()
          Returns the sum of weights of the missing values.
 int getNumClassValues()
          Returns the number of class values of the second dimension of the histogram.
 void increment(double nominalValueMapping, int classValueMapping, double weight)
          Increments the histogram count at the given position for the given weight.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NominalValueHistogram

public NominalValueHistogram()
Creates a nominal value histogram.


NominalValueHistogram

public NominalValueHistogram(NominalValueHistogram template)
Creates a nominal value histogram from the given template. The template supplies the histogram sizes.

Parameters:
template - the template histogram from which to initialize the new histogram
Method Detail

increment

public void increment(double nominalValueMapping,
                      int classValueMapping,
                      double weight)
Increments the histogram count at the given position for the given weight.

Parameters:
nominalValueMapping - the nominal index for which to increment the count
classValueMapping - the class index for which to increment the count
weight - the amount to increase the count

getMissingValueCount

public double getMissingValueCount()
Returns the sum of weights of the missing values.

Returns:
the sum of weights of the missing values

getHistogram

public double[][] getHistogram()
Returns the count histogram. First dimension are the valid (non-missing) nominal values. The second dimension are the valid class values.

Returns:
the count histogram; first dimension are the valid (non-missing) nominal values. The second dimension are the valid class values.

getNumClassValues

public int getNumClassValues()
Returns the number of class values of the second dimension of the histogram. NOTE: The value can increase when performing increments.

Returns:
the number of class values of the second dimension of the histogram


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.