Nominal
Details
- A nominal scale represents a set of categories, with no inherent ordering. Typical examples include types of products, names and places.
- There is no ordering between the categories; they are either equal or not.
- The categories cati can be any expression.
- In Nominal[scale], scale can be a list of categories, a NominalScale specification, a Nominal expression or an Association of category information.
- Nominal[scale][c] is equivalent to Nominal[scale,c].
Examples
open all close allBasic Examples (3)
Represent a possible set of a, b, c:
Nominal[{a, b, c}]Represent the category a from within the set:
Nominal[{a, b, c}, a]Create a list of categories from a category scale:
scale = Nominal[{"round", "square", "irregular"}]scale /@ {"square", "square", "round", "irregular"}scale = Nominal[<|"CategoryList" -> {"h", "t"}, "LabelList" -> {"Heads", "Tails"}|>]scale /@ {"t", "t", "h", "t", "h", "h", "h"}Scope (4)
A NominalScale expression may be used as a scale specification:
scale = Nominal[NominalScale[{"foo", "bar"}]]scale["bar"]A Nominal expression may be used as a scale specification:
scale = Nominal[{"red", "green", "blue"}]Nominal[scale, "blue"]Information will provide detailed information about a given Nominal expression:
Information[Nominal[{"x", "y", "z"}]]Information will also give details about a specific Nominal category:
Information[Nominal[{"x", "y", "z"}, "y"]]TabularColumn will automatically detect Nominal category expressions:
TabularColumn[{Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 2], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 3], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 2], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 3], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1]}]Normal will restore the original Nominal expressions:
Normal@%Applications (2)
Visualize a collection of categories with CategoricalHistogram:
CategoricalHistogram[{Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 3], Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 2], Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 3], Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 2], Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 3], Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 3], Nominal[Association["CategoryList" -> {"psychology", "rhetoric", "sociology"},
"LabelList" -> {"psychology", "rhetoric", "sociology"}, "ScoreList" -> {1, 2, 3}], 1]}]Get the probability of a given category within a CategoricalDistribution:
dist = CategoricalDistribution[Nominal[{"Windows", "Linux", "macOS", "Android", "iOS"}], {8, 3, 5, 2, 3}]Probability[x == Nominal[Association["CategoryList" -> {"Android", "iOS", "Linux", "macOS", "Windows"},
"LabelList" -> {"Android", "iOS", "Linux", "macOS", "Windows"}, "ScoreList" -> {1, 2, 3, 4, 5}],
4], xdist]Properties & Relations (3)
Ordinal expressions operate similarly to Nominal ones, with the exception of sorting:
cats = {"b", "c", "a"};nom = Nominal[cats]ord = Ordinal[cats]Since there is no inherent order to Nominal categories, they follow canonical order(e.g. alphabetical):
Sort[nom /@ cats]As such, there is no minimum category:
Min[nom /@ cats]Ordinal categories are sorted by their ordering within the scale:
Sort[ord /@ cats]This also applies to comparisons as well:
Min[ord /@ cats]CategoricalValue can be used to extract the underlying expression for a category:
CategoricalValue[Nominal[Association["CategoryList" -> {"a", "b", "c"}, "LabelList" -> {"a", "b", "c"},
"ScoreList" -> {1, 2, 3}], 1]]The same is true for an entire scale:
CategoricalValue[Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}]]]TabularColumn will automatically detect Nominal expressions:
nom = {Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 2], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 3], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 2], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 3], Nominal[Association["CategoryList" -> {"accrue", "choosy", "spuriously"},
"LabelList" -> {"accrue", "choosy", "spuriously"}, "ScoreList" -> {1, 2, 3}], 1]};TabularColumn[nom]The "ElementType" for columns of Nominal object is "Nominal":
%["ElementType"]History
Text
Wolfram Research (2026), Nominal, Wolfram Language function, https://reference.wolfram.com/language/ref/Nominal.html.
CMS
Wolfram Language. 2026. "Nominal." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Nominal.html.
APA
Wolfram Language. (2026). Nominal. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Nominal.html
BibTeX
@misc{reference.wolfram_2026_nominal, author="Wolfram Research", title="{Nominal}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/Nominal.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_nominal, organization={Wolfram Research}, title={Nominal}, year={2026}, url={https://reference.wolfram.com/language/ref/Nominal.html}, note=[Accessed: 12-June-2026]}