Oracle Data Mining Java API Reference
10g Release 1 (10.1)

B12276-01

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
 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 - 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:
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
Throws:
InvalidArgumentException -
  • when group value is null, or
  • when categories cannot be retrieved.

getCategoryGroups

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

getTopNFrequencies

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

getOtherCategoryName

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

Copyright © 2003 Oracle Corporation. All Rights Reserved.