liveBook · Manning

Upsampling

As explained in Natural Language Processing in Action, Second Edition

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.

Also explained in

Compare how 4 books explain upsampling →

Related concepts

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.