Category is a util class, contains a label, its display name, a float value as score, and the index of the label in the corresponding label file. Typically it's used as result of classification tasks.
Public Constructors
Public Methods
static Category | |
static Category | |
boolean | |
String |
getDisplayName()
Gets the reference of category's displayName, a name in locale of the label.
|
int |
getIndex()
Gets the index of the category.
|
String |
getLabel()
Gets the reference of category's label.
|
float |
getScore()
Gets the score of the category.
|
int |
hashCode()
|
String |
toString()
|
Inherited Methods
Public Constructors
Public Methods
public static Category create (String label, String displayName, float score, int index)
Constructs a Category
object.
Parameters
label | the label of this category object |
---|---|
displayName | the display name of the label, which may be translated for different locales. For exmaple, a label, "apple", may be translated into Spanish for display purpose, so that the displayName is "manzana". |
score | the probability score of this label category |
index | the index of the label in the corresponding label file |
public static Category create (String label, String displayName, float score)
Constructs a Category
object with the default index (-1).
Parameters
label | |
---|---|
displayName | |
score |
public String getDisplayName ()
Gets the reference of category's displayName, a name in locale of the label.
The display name can be an empty string if this Category
object is constructed
without displayName, such as when using Category(String, float)
.
public int getIndex ()
Gets the index of the category. The index value might be -1, which means it has not been set up properly and is invalid.
public float getScore ()
Gets the score of the category.