|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--shared.Schema
Schema defines the attribute information. Most effort was directed at labelled instances for supervised learning, and on discrete attributes.
| Inner Class Summary | |
class |
Schema.StringNum
String to Double transformation device. |
| Constructor Summary | |
Schema(java.util.LinkedList attrInfos)
Constructor. |
|
Schema(java.util.LinkedList attrInfos,
AttrInfo lInfo)
Constructor. |
|
Schema(Schema source)
Copy Constructor. |
|
| Method Summary | |
AttrInfo |
attr_info(int num)
Returns the AttrInfo object containing the specified attribute's information. |
java.lang.String |
attr_name(int attrNum)
Returns the name of the specified attribute. |
java.lang.String |
category_to_label_string(int cat)
Returns the name of the specified category label. |
void |
display_names(java.io.Writer stream,
boolean protectChars,
java.lang.String header)
Displays the names file associated with the instances. |
void |
establish_loss_matrix()
Allocates the loss matrix for this Schema object. |
static int |
findindexofmin(Schema.StringNum[] sn,
int start)
Finds the index of the minimum value in an array of StringNum values. |
double[][] |
get_loss_matrix()
Returns the loss matrix for this Schema object. |
boolean |
has_loss_matrix()
Checks if this Schema object has a loss matrix. |
boolean |
is_labelled()
Checks if this Schema has label information. |
boolean |
is_labelled(boolean fatalOnFalse)
Checks if this Schema has label information. |
boolean |
is_nominal()
Returns TRUE if all attributes in the schema are nominals } (or can be cast to nominals). |
AttrInfo |
label_info()
Returns the label information. |
NominalAttrInfo |
nominal_attr_info(int attrNum)
Casts the specified attribute to a nominal attribute. |
NominalAttrInfo |
nominal_label_info()
Casts the label information to a nominal attribute. |
int |
num_attr_values(int attrNum)
Returns the number of values possible for the specified attribute. |
int |
num_attr()
Returns the number of attributes in this Schema object. |
int |
num_label_values()
Returns the number of classification labels possible for this Schema. |
Schema |
project(boolean[] attrMask)
Creates a new Schema object which contains only the specified attributes. |
Schema |
remove_attr(int attrNum)
Returns a Schema with the given AttrInfo removed and the infos renumbered to be sequential starting at 0. |
void |
remove_loss_matrix()
Removes a loss matrix from this Schema object. |
void |
set_loss_matrix(double[][] aLossMatrix)
Sets the loss matrix to the matrix specified. |
int[] |
sort_labels()
Create permutation array for labels if sorting is requested The array is owned by the caller and must be deleted. |
static Schema.StringNum[] |
sort(Schema.StringNum[] sn)
Sorts an array of StringNums from smallest to greatest value. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public Schema(java.util.LinkedList attrInfos)
attrInfos - The information about each attribute to be
stored in this Schema.
public Schema(java.util.LinkedList attrInfos,
AttrInfo lInfo)
attrInfos - The information about the each attribute to be
stored in this Schema.lInfo - The information about the labels for each
catagory.
public Schema(Schema source)
throws java.lang.CloneNotSupportedException
source - The Schema object to be copied.| Method Detail |
public boolean has_loss_matrix()
public double[][] get_loss_matrix()
public void set_loss_matrix(double[][] aLossMatrix)
aLossMatrix - The new matrix to be stored in this Schema
object.public void establish_loss_matrix()
public Schema project(boolean[] attrMask)
throws java.lang.CloneNotSupportedException
attrMask - A boolean array where each element represents an attribute
in the Schema. It should have have the same number of
elements as attributes. Elements set to true will result in
the corresponding attribute being included in the new
Schema.public NominalAttrInfo nominal_attr_info(int attrNum)
attrNum - The index number of the specified attribute.public int num_attr_values(int attrNum)
attrNum - The index number of the specified attribute.public int num_label_values()
public NominalAttrInfo nominal_label_info()
public AttrInfo label_info()
public boolean is_labelled()
public boolean is_labelled(boolean fatalOnFalse)
fatalOnFalse - If set to TRUE, an error message will be displayed if
there is no label information in this Schema.public java.lang.String attr_name(int attrNum)
attrNum - The index number of the specified attribute.public int num_attr()
public AttrInfo attr_info(int num)
num - The index of the specified attribute.public java.lang.String category_to_label_string(int cat)
cat - The specified category.
public void display_names(java.io.Writer stream,
boolean protectChars,
java.lang.String header)
stream - The Writer to which the Schema will be displayed.protectChars - TRUE if characters should be protected for display.header - The String to use as a header to the display.public boolean is_nominal()
public int[] sort_labels()
public static Schema.StringNum[] sort(Schema.StringNum[] sn)
sn - An array of StringNum values to be sorted.
public static int findindexofmin(Schema.StringNum[] sn,
int start)
sn - The array of StringNum values to be searched.start - The start index.public void remove_loss_matrix()
public Schema remove_attr(int attrNum)
attrNum - The number of the attribute to be removed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||