|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--shared.Globals
|
+--shared.Categorizer
|
+--shared.ConstCategorizer
ConstCategorizer always gives the same category. Categories must be greater than UNKNOWN_CATEGORY_VAL. For safety reasons, an upper bound of MAX_NUM_CATEGORIES is exists.
| Constructor Summary | |
ConstCategorizer(java.lang.String dscr,
AugCategory augCat,
Schema sch)
This constructor builds the "all the eggs in one basket" type of const categorizer. |
|
ConstCategorizer(java.lang.String dscr,
CatDist pDist,
Schema sch)
This constructor allows full specification of the prediction distribution for this categorizer. |
|
| Method Summary | |
AugCategory |
categorize(Instance i)
Categorizes the given Instance. |
int |
class_id()
Deprecated. This method should be replaced with Java's instanceof operator. |
java.lang.Object |
clone()
Clones this ConstCategorizer. |
void |
display_struct(java.io.BufferedWriter stream,
DisplayPref dp)
Prints a readable representation of the ConstCategorizer to the given stream. |
CatDist |
get_cat_dist()
Returns the distribution of predicted categories. |
AugCategory |
get_category()
Returns the category that all Instances will be classified as. |
CatDist |
score(Instance i)
Returns the CatDist containing the weighted distribution score for the given Instance. |
void |
set_used_attr(boolean[] used)
Sets which attributes have been used in this ConstCategorizer. |
| Methods inherited from class shared.Categorizer |
build_distr,
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,
supports_scoring,
total_weight |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public ConstCategorizer(java.lang.String dscr,
AugCategory augCat,
Schema sch)
dscr - Description of this ConstCategorizer.augCat - Category that all Instances will be categorized as.sch - The Schema of attributes and labels for this Categorizer.
public ConstCategorizer(java.lang.String dscr,
CatDist pDist,
Schema sch)
dscr - Description of this ConstCategorizer.pDist - The distribution of predicted categories specified.sch - The Schema of attributes and labels for this Categorizer.| Method Detail |
public AugCategory categorize(Instance i)
i - The Instance to be categorized.public CatDist score(Instance i)
i - The Instance to be scored.public int class_id()
public AugCategory get_category()
public CatDist get_cat_dist()
public java.lang.Object clone()
public void display_struct(java.io.BufferedWriter stream,
DisplayPref dp)
stream - The Buffered Writer to which information will be
displayed.dp - The preferences for Display.public void set_used_attr(boolean[] used)
used - The attributes used. TRUE if the corresponding attribute has
been used.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||