|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--shared.Globals | +--shared.Categorizer | +--id3.NodeCategorizer | +--id3.LeafCategorizer
NodeCategorizer for categorizers that don't need to ask other categorizers for help scoring (i.e. leaves in the decision process). Since any categorizer can sit at a leaf in a decision tree / graph, this class serves as a wrapper for any Categorizer that doesn't care about whether or not it sits in a graph. This class is a pure wrapper to the inner categorizer. That is, it doesn't maintain any information at all except for the reference to the wrapped categorizer. The OK function should check that none of the local variables ever change from their dummy variables.
Constructor Summary | |
LeafCategorizer(Categorizer aCategorizer)
Constructor. |
Method Summary | |
AugCategory |
branch(Instance inst)
Returns the category for the given Instance. |
void |
build_distr(InstanceList instList)
builds an Instance distribution from the InstanceList. |
int |
class_id()
Deprecated. This method should be replaced with Java's instanceof operator. |
java.lang.Object |
clone()
Clone function. |
java.lang.String |
description()
Returns the description of the Categorizer stored in this LeafCategorizer. |
void |
display_struct(java.io.BufferedWriter stream,
DisplayPref pref)
Displays the structure of the Categorizer stored in this LeafCategorizer. |
Categorizer |
get_categorizer()
Returns the Categorizer stored in this LeafCategorizer. |
int |
num_categories()
Returns the number of categories for the categorizer stored in this LeafCategorizer. |
CatDist |
score(Instance inst)
Scores the given Instance using the categorizer stored in this LeafCategorizer. |
CatDist |
score(Instance inst,
boolean addLoss)
Scores the given Instance using the categorizer stored in this LeafCategorizer. |
void |
set_description(java.lang.String val)
Sets the description of this LeafCategorizer to the given value. |
void |
set_distr(double[] val)
Sets the distribution to the given values. |
void |
set_used_attr(boolean[] used)
Sets which attributes have been used for the attributes in the Categorizer stored in this LeafCategorizer. |
boolean |
supports_scoring()
Returns whether this Categorizer subclass supports scoring. |
double |
total_weight()
Returns the total weight of instances that reach this LeafCategorizer. |
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,
set_graph_and_node,
split_instance_list,
stop,
toString,
update_loss |
Methods inherited from class shared.Categorizer |
get_distr,
get_log_level,
get_log_options,
get_log_stream,
get_schema,
has_distr,
set_log_level,
set_log_options,
set_log_prefixes,
set_log_stream,
set_original_distr |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public LeafCategorizer(Categorizer aCategorizer)
aCategorizer
- The Categorizer that will be stored in this LeafCategorizer.Method Detail |
public int class_id()
public AugCategory branch(Instance inst)
inst
- The instance to be checked.public Categorizer get_categorizer()
public java.lang.Object clone()
public void set_used_attr(boolean[] used)
used
- The attributes used. TRUE indicates that attribute is used, FALSE otherwise.public void display_struct(java.io.BufferedWriter stream, DisplayPref pref)
stream
- The BufferedWriter to which this LeafCategorizer will be displayed.pref
- The preferences for display.public int num_categories()
public java.lang.String description()
public CatDist score(Instance inst)
inst
- The Instance given for categorization.public CatDist score(Instance inst, boolean addLoss)
inst
- The Instance given for categorization.addLoss
- TRUE if Instance loss is to be added, FALSE otherwise.public void build_distr(InstanceList instList)
instList
- The list of Instances from which a distribution is to be built.public void set_description(java.lang.String val)
val
- The new description for this Node Categorizer.public boolean supports_scoring()
public void set_distr(double[] val)
val
- An array containing the new distribution values.public double total_weight()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |