Package smile.data.measure
Class NominalScale
java.lang.Object
smile.data.measure.CategoricalMeasure
smile.data.measure.NominalScale
- All Implemented Interfaces:
Serializable
,Measure
Nominal variables take on a limited number of unordered values.
Such variables are often referred to as categorical variables.
Examples include gender, nationality, ethnicity, language,
genre, style, biological species, etc.
The nominal type differentiates between items or subjects based only on their names or (meta-)categories and other qualitative classifications they belong to. Numbers may be used to represent the variables but the numbers have no specific numerical value or meaning. No form of arithmetic computation (+, −, ×, etc.) may be performed on nominal measures.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionNominalScale
(int[] values, String[] levels) Constructor.NominalScale
(Class<? extends Enum<?>> clazz) Constructor.NominalScale
(String... levels) Constructor.NominalScale
(List<String> levels) Constructor. -
Method Summary
-
Constructor Details
-
NominalScale
Constructor.- Parameters:
levels
- the levels of nominal values.
-
NominalScale
Constructor.- Parameters:
values
- the valid values.levels
- the levels of discrete values.
-
NominalScale
Constructor.- Parameters:
levels
- the levels of discrete values.
-
NominalScale
Constructor.- Parameters:
clazz
- an Enum class.
-
-
Method Details
-
toString
-
equals
- Overrides:
equals
in classCategoricalMeasure
-