oracle.dmt.odm.transformation
Class CategoricalDiscretization

java.lang.Object
  |
  +--oracle.dmt.odm.transformation.AttributeDiscretization
        |
        +--oracle.dmt.odm.transformation.CategoricalDiscretization

public class CategoricalDiscretization
extends AttributeDiscretization

Associated with an attribute CategoricalDiscretization allows a user to specify category groups or use automated discretization (binning) involving the N most frequent items.

This specification applies to Transactional class methods.

An object of type CategoricalDiscretization can be constructed in two ways:

  1. By explicitly specifying all the categories for a given attribute.
  2. By specifying a number N as topNFrequencies. This assigns the top N most frequent values their own bins (bin numbers start at 1); it assigns all the less frequent values to the "Other" bin.


Constructor Summary
CategoricalDiscretization(CategoryGroup[] groups)
          Creates a CategoricalDiscretization instance with the specified category groups.
CategoricalDiscretization(int topNFrequencies, java.lang.String otherCategoryName)
          Creates a CategoricalDiscretization instance with topNFrequencies and the "Other" category name.
 
Method Summary
TypeMethod
 void addCategoryGroup(CategoryGroup group)
          Adds a category group to this categorical discretization.
 CategoryGroup[] getCategoryGroups()
          Returns the list of categoryGroups in the categorical discretization.
 java.lang.String getOtherCategoryName()
          Returns the name of the "Other" bin.
 int getTopNFrequencies()
          Returns the number of the top most frequent values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CategoricalDiscretization

public CategoricalDiscretization(CategoryGroup[] groups)
                          throws InvalidArgumentException
Creates a CategoricalDiscretization instance with the specified category groups.

A valid group must have at least one category in it.

Parameters:
groups - - Category groups
Throws:
InvalidArgumentException - - Thrown when the groups specified are not valid.

CategoricalDiscretization

public CategoricalDiscretization(int topNFrequencies,
                                 java.lang.String otherCategoryName)
                          throws InvalidArgumentException
Creates a CategoricalDiscretization instance with topNFrequencies and the "Other" category name.
Parameters:
topNFrequenies - - Top N most frequent values which will get their own bins
otherCategoryName - - Name of the "Other" bin
Throws:
InvalidArgumentException -  
Method Detail

addCategoryGroup

public void addCategoryGroup(CategoryGroup group)
                      throws InvalidArgumentException
Adds a category group to this categorical discretization. The list of categories in a group cannot be empty.
Parameters:
group - - Category group
Returns:
void

getCategoryGroups

public CategoryGroup[] getCategoryGroups()
Returns the list of categoryGroups in the categorical discretization.
Returns:
CategoryGroup[] - Array of category groups

getTopNFrequencies

public int getTopNFrequencies()
Returns the number of the top most frequent values.
Returns:
topNFrequencies - Number of top frequencies.

getOtherCategoryName

public java.lang.String getOtherCategoryName()
Returns the name of the "Other" bin.
Returns:
otherCategoryName - Name of "Other" category.