|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--shared.BagCounters
The BagCounters class provides support for instance list counters. Counters are provided only for nominal attributes. It is an error to call counters with a non-nominal attribute. All counters are real-valued to provide instance weighting. Unlabelled lists are now supported.
It is assumed the list is labelled and the label must be of nominal type. All non-nominal attributes contain a NULL value, instead of an array of values.
| Constructor Summary | |
BagCounters(BagCounters source)
Copy constructor. |
|
BagCounters(Schema aSchema)
Constructor. |
|
| Method Summary | |
void |
add_instance(Instance instance)
Adds the given Instance to the counting bags. |
double |
attr_count(int attrNum,
int attrVal)
Return the value of the attribute counter. |
double[][] |
attr_counts()
Returns the matrix of attribute counts. |
int |
attr_num_vals(int attrNum)
Returns the number of attribute values that are actually found in the counted Instances for a specified attribute. |
void |
del_instance(Instance instance)
Deleted the given Instance to the counting bags. |
void |
display(java.io.BufferedWriter stream)
Displays this BagCounters to the specified output stream. |
double |
label_count(int labelVal)
Returns the count of a specific label. |
double[] |
label_counts()
Returns the array of counting bags. |
int |
label_num_vals()
Returns the number of label values that are actually found in the counted Instances. |
java.lang.String |
toString()
Convert the counter bag to a string. |
protected void |
update_counters(Instance instance,
int delta)
Update counters (either increment or decrement) according to the given labelled Instance. |
double |
val_count(int labelVal,
int attrNum,
int attrVal)
Returns the value of a value counter. |
double[][][] |
value_counts()
Returns the 3D matrix of attribute value counting bags. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public BagCounters(Schema aSchema)
aSchema - Schema of the Instances for which counting will be done.public BagCounters(BagCounters source)
source - The BagCounters to be copied.| Method Detail |
public void add_instance(Instance instance)
instance - The Instance to be added. The Instance should be labelled.public void del_instance(Instance instance)
instance - The Instance to be deleted. The Instance should be
labelled.public double[] label_counts()
public double[][][] value_counts()
public double attr_count(int attrNum,
int attrVal)
attrNum - The number of the attribute for which a count is
requested.attrVal - The number of the value of the attribute for which
a count is requested.public double[][] attr_counts()
public int label_num_vals()
public int attr_num_vals(int attrNum)
attrNum - The number of the attribute to be checked.public double label_count(int labelVal)
labelVal - The specific value to be checked.
protected void update_counters(Instance instance,
int delta)
instance - The Instance to be added/deleted from the BagCounters.delta - Indicates whether given Instance is to be added or
deleted. 1 indicates addition. -1 indicates
deletion.public void display(java.io.BufferedWriter stream)
stream - The output stream to be written to.public java.lang.String toString()
public double val_count(int labelVal,
int attrNum,
int attrVal)
labelVal - The value of the label classification for which counters
are requested.attrNum - The number of the attribute for which counters are
requested.attrVal - The number of the value of the attribute for which
counters are requested.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||