Oversampling the minority class increases the representation of underrepresented classes in training data, often by duplicating or resampling examples.
Upsampling increases the representation of an underrepresented class by duplicating or resampling its examples. In surname classification, it can balance nationality frequencies so an RNN learns letter patterns rather than favoring common names or populous countries. section 8.2
Duplicated Arabic surnames
The Arabic dataset contains 2,000 examples but only 108 unique surnames. Listing the values shows repeated entries such as Abadi and Zogby; this brute-force duplication raises the class's training frequency. section 8.2
How Natural Language Processing in Action, Second Edition covers it
How deep it goes
Defines duplication as a brute-force balancing method and demonstrates its dataset effect, but does not detail alternative resampling algorithms.
Examples
Uses Arabic surnames including repeated Abadi and Zogby entries within a 37-nationality dataset.
What it assumes
Assumes labeled surname–nationality data and teaches imbalance through duplicate counts and class-frequency comparisons.
What you can do after
Apply it via duplicated or balanced surname samples before training a nationality-prediction RNN.
How it connects
Connects oversampling with class imbalance, RNN generalization, linguistic features, and confusion matrices.
Grokking AI Algorithms, Second EditionUpsampling is the process of increasing the spatial resolution of a structured representation such as an image or feature map.
Deep Learning with R, Third EditionUpsampling is the expansion of a representation's spatial resolution by generating or restoring values at additional spatial locations.
SMOTEincludes · SMOTE is an oversampling technique that generates synthetic examples for a minority class by interpolating between existing minority-class examples and their nearest neighbors.
Conv2DTransposeimplemented by · Conv2DTranspose is a neural-network layer that applies a learned two-dimensional transposed convolution to increase the spatial resolution of feature maps.
class imbalanceaddressed by · Class imbalance is a condition in a classification dataset where classes have substantially unequal numbers of examples.
transposed convolutionimplemented by · A transposed convolution is a learnable convolution-like operation corresponding to the transpose of a convolution operator and often used to increase spatial resolution.
This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.