|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cmu.minorthird.classify.ExampleSchema
public class ExampleSchema
Defines legal formats for examples. Currently this just checks that the class labels are in some legal set.
Field Summary | |
---|---|
static ExampleSchema |
BINARY_EXAMPLE_SCHEMA
Schema for binary examples. |
static java.lang.String |
NEG_CLASS_NAME
|
static java.lang.String |
POS_CLASS_NAME
|
Constructor Summary | |
---|---|
ExampleSchema(java.lang.String[] validClassNames)
Create a new scheme with the given list of validClassNames |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
void |
extend(java.lang.String newClassName)
Added extend method to extend the schema with new class label value |
int |
getClassIndex(java.lang.String name)
Return index of this class name, or -1 if it's not valid. |
java.lang.String |
getClassName(int i)
Return i-th valid class name. |
int |
getNumberOfClasses()
Return number of valid class names |
boolean |
isValid(ClassLabel label)
Determine if a ClassLabel is valid with respect to the schema. |
boolean |
isValid(Example e)
Determine if an example is valid with respect to the schema. |
java.lang.String |
toString()
|
java.lang.String[] |
validClassNames()
Get an array of all valid class names. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String POS_CLASS_NAME
public static final java.lang.String NEG_CLASS_NAME
public static final ExampleSchema BINARY_EXAMPLE_SCHEMA
Constructor Detail |
---|
public ExampleSchema(java.lang.String[] validClassNames)
Method Detail |
---|
public void extend(java.lang.String newClassName)
public java.lang.String[] validClassNames()
public int getNumberOfClasses()
public java.lang.String getClassName(int i)
public int getClassIndex(java.lang.String name)
public boolean isValid(ClassLabel label)
public boolean isValid(Example e)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |