shared
Class BadCategorizer

java.lang.Object
  |
  +--shared.Globals
        |
        +--shared.Categorizer
              |
              +--shared.BadCategorizer

public class BadCategorizer
extends Categorizer

The BadCategorizer class is used for repeated references to categorizers that either don't exist or are not specified. All methods other than constructor and destructor dispay fatal_error messages. This allows faster comparison using is_bad_categorizer() and prevents some unnecessary waste of memory.


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
BadCategorizer()
          Checks if BadCategorizer has not been instantiated and creates one if it has.
 
Method Summary
 AugCategory categorize(Instance i)
          Categorizes an Instance.
 int class_id()
          Deprecated. Java's instanceof operator should be used.
 java.lang.Object clone()
          Clones this BadCategorizer.
 void display_struct(java.io.BufferedWriter stream, DisplayPref dp)
          Displays the structure for this categorizer.
 int num_categories()
          Returns the number of categories in this categorizer.
 void set_used_attr(boolean[] usedAttr)
          Updates usedAttr to include the attributes used in this categorizer.
 
Methods inherited from class shared.Categorizer
build_distr, description, get_distr, get_log_level, get_log_options, get_log_stream, get_schema, has_distr, score, set_description, set_distr, set_log_level, set_log_options, set_log_prefixes, set_log_stream, set_original_distr, supports_scoring, total_weight
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BadCategorizer

public BadCategorizer()
Checks if BadCategorizer has not been instantiated and creates one if it has. Updates "instantiated".
Method Detail

class_id

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

Identifies this objects class as a BadCategorizer.
Returns:
The number identifing this class. In this case -1.

clone

public java.lang.Object clone()
Clones this BadCategorizer. Displays an error message.
Overrides:
clone in class Categorizer
Returns:
The clone of this BadCategorizer.

display_struct

public void display_struct(java.io.BufferedWriter stream,
                           DisplayPref dp)
Displays the structure for this categorizer. Displays an error message.
Overrides:
display_struct in class Categorizer
Parameters:
stream - The output stream to be written to.
dp - The preferences for displaying.

set_used_attr

public void set_used_attr(boolean[] usedAttr)
Updates usedAttr to include the attributes used in this categorizer. Displays an error message.
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.

num_categories

public int num_categories()
Returns the number of categories in this categorizer. Displays an error message.
Overrides:
num_categories in class Categorizer
Returns:
The number of categories.

categorize

public AugCategory categorize(Instance i)
Categorizes an Instance. Displays an error message.
Overrides:
categorize in class Categorizer
Parameters:
i - The specified Instance.
Returns:
The category the specified Instance is labelled.