id3
Class AttrCategorizer

java.lang.Object
  |
  +--shared.Globals
        |
        +--shared.Categorizer
              |
              +--id3.NodeCategorizer
                    |
                    +--id3.AttrCategorizer

public class AttrCategorizer
extends NodeCategorizer

The AttrCategorizer categorizes an Instance based on an attribute. Assumes the attribute is of a type derived from Nominal.


Fields inherited from class shared.Categorizer
CATEGORIZER_ID_BASE, CLASS_ATTR_CATEGORIZER, CLASS_ATTR_EQ_CATEGORIZER, CLASS_ATTR_SUBSET_CATEGORIZER, CLASS_BAD_CATEGORIZER, CLASS_BAGGING_CATEGORIZER, CLASS_CASCADE_CATEGORIZER, CLASS_CLUSTER_CATEGORIZER, CLASS_CONST_CATEGORIZER, CLASS_CONSTRUCT_CATEGORIZER, CLASS_DISC_CATEGORIZER, CLASS_DISC_NODE_CATEGORIZER, CLASS_DTREE_CATEGORIZER, CLASS_IB_CATEGORIZER, CLASS_LAZYDT_CATEGORIZER, CLASS_LEAF_CATEGORIZER, CLASS_LINDISCR_CATEGORIZER, CLASS_MAJORITY_CATEGORIZER, CLASS_MULTI_SPLIT_CATEGORIZER, CLASS_MULTITHRESH_CATEGORIZER, CLASS_NB_CATEGORIZER, CLASS_ODT_CATEGORIZER, CLASS_ONE_R_CATEGORIZER, CLASS_OPTION_CATEGORIZER, CLASS_PROJECT_CATEGORIZER, CLASS_RDG_CATEGORIZER, CLASS_STACKING_CATEGORIZER, CLASS_TABLE_CATEGORIZER, CLASS_THRESHOLD_CATEGORIZER, logOptions
 
Fields inherited from class shared.Globals
badCategorizer, CONFIDENCE_INTERVAL_Z, DBG, DEFAULT_DATA_EXT, DEFAULT_EPSILON, DEFAULT_EVAL_LIMIT, DEFAULT_LAMBDA, DEFAULT_MAX_EVALS, DEFAULT_MAX_STALE, DEFAULT_MIN_EXP_EVALS, DEFAULT_NAMES_EXT, DEFAULT_SAS_SEED, DEFAULT_SEARCH_METHOD, DEFAULT_SHOW_TEST_SET_PERF, DEFAULT_TEST_EXT, DISPLAY_NAMES, EMPTY_STRING, FIRST_CATEGORY_VAL, FIRST_NOMINAL_VAL, LEFT_NODE, MAX_NUM_CATEGORIES, Mcerr, Mcout, optionServer, optionsFileName, REAL_MAX, RIGHT_NODE, SHOW_TEST_SET_PERF_HELP, SINGLE_QUOTE, STORED_REAL_MAX, TS, UNDEFINED_INT, UNDEFINED_REAL, UNDEFINED_VARIANCE, UNKNOWN_AUG_CATEGORY, UNKNOWN_CATEGORY_VAL, UNKNOWN_NODE, UNKNOWN_NOMINAL_VAL, UNKNOWN_STORED_REAL_VAL, UNKNOWN_VAL_STR
 
Constructor Summary
AttrCategorizer(Schema schma, int attributeNum, java.lang.String dscr)
          Constructor.
 
Method Summary
 AugCategory branch(Instance inst)
          Choses the child branch that the given instance would go down.
 int class_id()
          Deprecated. Java's instanceof operator should be used instead.
 void display_struct(java.io.BufferedWriter stream, DisplayPref dp)
          Prints a readable representation of the Categorizer to the given stream.
static int num_nominal_attr(Schema schema, int attrNum)
          Finds the number of attributes that are nominal in nature.
 void set_used_attr(boolean[] usedAttr)
          Updates usedAttr to include the attributes used in this categorizer.
 
Methods inherited from class id3.NodeCategorizer
add_instance_loss, categorize, distribute_instances, get_child_categorizer, get_child_categorizer, get_graph, get_loss, get_node, in_graph, reset_node_loss, score, score, set_graph_and_node, split_instance_list, stop, supports_scoring, toString, update_loss
 
Methods inherited from class shared.Categorizer
build_distr, clone, description, get_distr, get_log_level, get_log_options, get_log_stream, get_schema, has_distr, num_categories, set_description, set_distr, set_log_level, set_log_options, set_log_prefixes, set_log_stream, set_original_distr, total_weight
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttrCategorizer

public AttrCategorizer(Schema schma,
                       int attributeNum,
                       java.lang.String dscr)
Constructor.
Parameters:
schma - The schema for this categorizer.
attributeNum - The number of the specific attribute in the schema for the data.
dscr - The description of this categorizer.
Method Detail

num_nominal_attr

public static int num_nominal_attr(Schema schema,
                                   int attrNum)
Finds the number of attributes that are nominal in nature.
Parameters:
schema - The schema containing attribute and label information.
attrNum - The number of the specific attribute in the schema for the data.
Returns:
The number of nominal attributes.

class_id

public int class_id()
Deprecated. Java's instanceof operator should be used instead.

Identifies the class.
Returns:
A value uniquely identifying this object as an AttrCategorizer.

branch

public AugCategory branch(Instance inst)
Choses the child branch that the given instance would go down. Used for scoring, categorization, and splitting of InstanceLists.
Overrides:
branch in class NodeCategorizer
Parameters:
inst - The specified Instance.
Returns:
The AugCategory that correlates to the specified Instance.

display_struct

public void display_struct(java.io.BufferedWriter stream,
                           DisplayPref dp)
Prints a readable representation of the Categorizer to the given stream.
Overrides:
display_struct in class Categorizer
Parameters:
stream - The output stream to be written to.
dp - The preference settings for the display.

set_used_attr

public void set_used_attr(boolean[] usedAttr)
Updates usedAttr to include the attributes used in this categorizer.
Overrides:
set_used_attr in class Categorizer
Parameters:
usedAttr - A boolean array representing attributes. Each element set to TRUE indicates the attribute is used. It is FALSE otherwise. This method sets the appropriate attribute element to true.