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

java.lang.Object
  extended by org.knime.base.node.mine.decisiontree2.learner.Split
      extended by org.knime.base.node.mine.decisiontree2.learner.SplitNominal
          extended by org.knime.base.node.mine.decisiontree2.learner.SplitNominalNormal

public class SplitNominalNormal
extends SplitNominal

This class determines the best split for a nominal attribute. The split is performed by creating one partition for each nominal value, i.e. the branching degree of the tree.

Author:
Christoph Sieb, University of Konstanz

Field Summary
 
Fields inherited from class org.knime.base.node.mine.decisiontree2.learner.Split
m_splitQualityMeasure
 
Constructor Summary
SplitNominalNormal(InMemoryTable table, int attributeIndex, SplitQualityMeasure splitQualityMeasure, double minObjectsCount)
          Constructs the best split for the given nominal attribute.
 
Method Summary
 boolean canBeFurtherUsed()
          For normal nominal splits it makes no sense to be used in deeper levels.
 int getNumberPartitions()
          The number of partitions of a normal nominal split corresponds to the number of different nominal values of the attribute.
 int getPartitionForRow(DataRowWeighted row)
          Returns the partition the given row belongs to according to this split.
 double[] getPartitionWeights()
          Returns the partition weights.
 
Methods inherited from class org.knime.base.node.mine.decisiontree2.learner.SplitNominal
getSplitValues
 
Methods inherited from class org.knime.base.node.mine.decisiontree2.learner.Split
getAttributeIndex, getBestQualityMeasure, getQualityMeasureName, getSplitAttributeName, getTable, isValidSplit, setBestQualityMeasure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SplitNominalNormal

public SplitNominalNormal(InMemoryTable table,
                          int attributeIndex,
                          SplitQualityMeasure splitQualityMeasure,
                          double minObjectsCount)
Constructs the best split for the given nominal attribute. The results can be retrieved from getter methods.

Parameters:
table - the attribute list for which to create the split
attributeIndex - the index of the attribute for which to calculate the split
splitQualityMeasure - the split quality measure (e.g. gini or gain ratio)
minObjectsCount - the minimumn number of objects in at least two partitions
Method Detail

getNumberPartitions

public int getNumberPartitions()
The number of partitions of a normal nominal split corresponds to the number of different nominal values of the attribute. Return the number of partitions resulting from this split.

Specified by:
getNumberPartitions in class Split
Returns:
the number of partitions resulting from this split

canBeFurtherUsed

public boolean canBeFurtherUsed()
For normal nominal splits it makes no sense to be used in deeper levels. Returns true if it makes sense to use this split's attribute further in deeper levels, false if not.

Specified by:
canBeFurtherUsed in class Split
Returns:
true if it makes sense to use this split's attribute further in deeper levels, false if not

getPartitionForRow

public int getPartitionForRow(DataRowWeighted row)
Returns the partition the given row belongs to according to this split. If the value of the split attribute is missing (i.e. NaN) -1 is returned.

Specified by:
getPartitionForRow in class Split
Parameters:
row - the row for which to get the partition index
Returns:
the partition the given row belongs to according to this split; if the value of the split attribute is missing (i.e. NaN) -1 is returned

getPartitionWeights

public double[] getPartitionWeights()
Returns the partition weights. The weights represent the relative frequency of valid rows per partition. The weights are normally used to adapt the weight of rows whose split value is missing. Such a row is then assigned to each parition with the adapted weight.

Specified by:
getPartitionWeights in class Split
Returns:
the partition weights


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.