AI Glossary / Natural language and speech / Advanced

Relative frequency

Definition

Relative frequency is the number of times an outcome occurs divided by the total number of relevant observations. It expresses an observed share as a fraction, decimal, or percentage. For 12 occurrences among 80 observations, it is 12/80=15%. The observation unit and denominator must be defined.

What it means

An absolute frequency tells you how many occurrences were counted. Relative frequency tells you how large that count is compared with the relevant total. Ten complaints among 100 messages represent a different share from ten among 1,000 messages, even though the complaint count is the same.
In language processing, the observations might be word tokens, documents, or instances of a particular context. Token shares and the proportion of documents containing a word answer different questions.
Relative frequency describes collected data. It can support probability estimation under appropriate assumptions, but does not automatically equal the probability of a future occurrence. Sampling, changing conditions, and the way observations were collected affect that interpretation.

How it works

First define what counts as one observation and which observations are eligible. Then count the occurrences of the outcome of interest and divide by the eligible total. Multiply by 100 to express the result as a percentage. A zero denominator makes this calculation undefined; it should not be silently reported as zero percent.
If each observation belongs to exactly one category and the categories cover all observations, their relative frequencies sum to one before rounding. Overlapping labels require a different interpretation: their percentages need not sum to 100%, because one observation may contribute to several numerators.
Conditional relative frequency restricts the denominator to a specified context. For a word bigram, an unsmoothed estimate of the next word's probability counts that continuation relative to eligible occurrences of the preceding context. Boundary conventions and tokenization must be consistent.
Combining groups also requires care. Adding counts and totals gives a pooled proportion. Taking an unweighted average of group percentages instead gives every group equal influence, even when their sizes differ. Explain which summary is intended.

Three practical examples

  • A support team compares the share of messages assigned to a topic across weeks with different message volumes.
  • A corpus analyst reports how often a word appears per thousand tokens, while separately reporting how many documents contain it.
  • A language-model exercise estimates the distribution of continuations after a chosen word from observed counts, then examines the effect of unseen continuations.

Think of it this way

Think of counting colored counters in a jar. The count of blue counters is an absolute frequency; the blue share depends on how many counters are in the jar altogether. Jars with equal blue counts can have different proportions. Combining jars requires combining counts and totals.

Worked example

Consider an original hypothetical corpus split into two collections. Collection A contains 200 word tokens, including 20 occurrences of repair. Collection B contains 800 tokens, including 40 occurrences of repair. Assume the same case normalization and tokenization rules were applied to both.
The relative frequency in A is 20/200=0.10, or 10%. In B it is 40/800=0.05, or 5%. B contains twice as many occurrences of repair, but the word occupies half the share of its tokens compared with A.
Pooling the collections gives 60 occurrences among 1,000 tokens, so the combined relative frequency is 60/1,000=0.06, or 6%. The unweighted average of 10% and 5% is 7.5%, which is not the pooled token proportion. Weighting by collection size gives 0.2×10%+0.8×5%=6%.
Now suppose the pooled corpus contains 50 documents, and repair appears in 15 of them. Its document occurrence proportion is 15/50=30%. This coexists with the 6% token frequency because the observation units differ. Repeated occurrences within one document contribute repeatedly to token counts but only once to the document-presence count.
Finally, suppose the context “please” has 40 eligible next-token positions. Repair follows it 12 times, inspect follows it eight times, and other continuations occupy the remaining 20 positions. The conditional relative frequencies are 12/40=30%, 8/40=20%, and 20/40=50%. They sum to 100% for this exhaustive grouping.
The conditional 30% for repair after please is not its overall 6% token frequency. A continuation absent from these 40 positions would have empirical frequency zero, but that does not establish that it is impossible in future text. A smoothed language model can assign it positive probability without claiming that it was observed.
These are invented teaching numbers, not measured corpus results.

Illustrative case study

Fictional example: TopicMeter reports that mentions of a product fault doubled after a launch. Reviewers discover that the number of collected messages increased fourfold during the same period. The absolute count rose, while the fault's share of messages fell.
The team adds both counts and denominators to the report and documents how messages are deduplicated and labeled. It separates token counts from message presence. The scenario illustrates how denominators change interpretation; it does not establish whether the product improved or whether the collected messages represent all customers.

Common misconceptions and mistakes

A larger count does not necessarily mean a larger relative frequency. Missing denominators can conceal small or changing samples. Rounded percentages may also sum to slightly more or less than 100% even when the unrounded categories form a complete partition.
Another mistake is treating zero observed occurrences as proof of impossibility. Likewise, an empirical proportion is not automatically a reliable forecast. Repeated, dependent, or selectively collected observations may offer less information about a wider population than their raw count suggests. Describing the dataset and generalizing beyond it are separate steps.

Business use

Show the numerator, denominator, observation unit, and collection period alongside important percentages. Use consistent inclusion rules when comparing teams or time periods. Check whether categories overlap and whether missing values were excluded. When a relative frequency informs planning, assess how representative the underlying observations are and whether the conditions are likely to remain comparable.

People also ask

Can relative frequency exceed one?

Not when it is a valid count of a subset divided by its total.

Is it the same as absolute frequency?

No. Absolute frequency is the count; relative frequency normalizes that count.

Can percentages from different groups simply be averaged?

Only if equal group weighting answers the intended question.

Check your understanding

Why is the pooled token share 6% rather than 7.5%?

Answer: The collections have unequal sizes.

What denominator gives document presence?

Answer: The number of eligible documents.

Does an unseen continuation have to be impossible?

Answer: No.

Related terms

  • Absolute frequency
  • Proportion
  • Conditional probability
  • Smoothing
  • Sampling
  • empirical probability
  • token frequency
  • document frequency

Learn next

Calculate counts and proportions for the same dataset using tokens and documents as separate units. Then compare pooled and equally weighted group summaries, documenting which question each answers.

More in Natural language and speech

  • Regular expression - A regular expression is a pattern notation used to describe and match sets of strings.
  • Relatedness - Relatedness is the degree to which words, concepts, or other items are meaningfully connected.
  • Relation extraction - Relation extraction is the task of identifying semantic relationships between entities mentioned in text and representing those relationships in a...
  • Relevance - Relevance is the property of bearing on a particular question, task, or choice of action.
  • Reporting events - Reporting events are acts of communicating information, such as saying, stating, or reporting something.
  • Residual stream - The residual stream is the sequence of vector representations passed through a transformer's residual connections.

Sources

Australian Bureau of Statistics, statistical terms and concepts glossary, relative frequency: https://www.abs.gov.au/statistics/understanding-statistics/statistical-terms-and-concepts/statistical-terms-and-concepts-glossary Jurafsky and Martin, Speech and Language Processing, chapter 3, count-based language-model estimation: https://web.stanford.edu/~jurafsky/slp3/3.pdf

Previous: Relationship square Next: Relative frequency view

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer