AI Glossary / Graphs and symbolic AI / Intermediate
Weighted training set
Definition
A weighted training set assigns a numerical weight to each training example, allowing examples to contribute differently to learning. In a common formulation, nonnegative weights multiply the examples' losses before those losses are combined. This differs from model weights, which are learned parameters: training-example weights control the relative influence of observations on the learning process.
What it means
Equal example weights recover the usual equal-contribution treatment. Larger weights give an example greater influence under the specified objective; zero weight removes its direct loss contribution. At least one weight must be positive when computing a normalized weighted mean.
Weights can express different intentions, including a chosen cost emphasis, a sampling correction, or the changing distribution used by a boosting algorithm. These meanings are not interchangeable. A large weight does not automatically mean that the observation is more reliable, more representative, or more common in the population. Its interpretation comes from how it was constructed.
How it works
For examples indexed by i, one common weighted objective is the sum of a_i times loss_i, divided by the sum of a_i. The learner then adjusts its parameters to reduce this objective. Other implementations may use different normalization conventions, so the formula should be recorded explicitly.
In AdaBoost, the algorithm maintains a distribution over examples and changes it across rounds so subsequent learners focus more on difficult examples. A fixed weighted dataset need not involve boosting at all. Some systems use weights directly; others sample examples according to weights. Resampling introduces randomness and is not necessarily identical to a direct weighted calculation in one finite run.
Three practical examples
- A regression experiment can assign greater cost importance to a defined class of prediction errors through example weights.
- A boosting procedure can update its example distribution after each base learner, altering which mistakes receive attention.
- A dataset study can compare weighted and unweighted evaluation results to make the effect of a chosen weighting policy visible.
Think of it this way
Think of a discussion in which each participant's statement receives a specified amount of attention. Giving one statement eight times the attention changes the discussion without creating eight independent pieces of evidence. The analogy is limited because a training algorithm follows a precise numerical objective, and statistical weighting may have a justification very different from a human decision about importance.
Worked example
Consider an original regression dataset with target values 0, 2, and 10. Suppose the model must predict one constant c for every example, and the loss is squared error.
With equal weights, the best constant is the ordinary mean, c = (0 + 2 + 10)/3 = 4. Its mean squared error is (16 + 4 + 36)/3 = 56/3, approximately 18.67.
Now assign weights 1, 1, and 8. Under the normalized weighted squared-error objective, the best constant becomes the weighted mean: c = (1*0 + 1*2 + 8*10)/10 = 8.2. At c = 4, the weighted loss is (16 + 4 + 8*36)/10 = 30.8. At c = 8.2, it is (67.24 + 38.44 + 8*3.24)/10 = 13.16.
The new constant improves the weighted objective but makes the ordinary unweighted error worse: (67.24 + 38.44 + 3.24)/3 is approximately 36.31. There is no contradiction. The two objectives give different importance to the same three observations.
Multiplying every weight by ten leaves this normalized objective unchanged, because numerator and denominator both scale by ten. But if an implementation uses an unnormalized sum together with a separate regularization penalty, changing all weights can change the balance between data fitting and regularization. Weight normalization is therefore part of the model specification, not merely a formatting choice.
Illustrative case study
Fictional case: an equipment-support team gives extra weight to a rare ticket category when training a classifier. Overall unweighted accuracy decreases slightly, while performance on the emphasized category improves in its validation exercise.
The team reports both views and examines the operational cost of different mistakes. It checks whether the weights match the intended service priorities and whether noisy labels are receiving too much influence. The case illustrates a possible trade-off; it does not claim that weighting always improves rare-category performance or establishes fairness.
Common misconceptions and mistakes
Do not confuse sample weights with feature coefficients or ensemble voting weights. Do not describe reweighted observations as new independent data. A dataset still contains the same underlying examples, even if their loss contributions change.
Also avoid assuming that weighting repairs missing information. If no examples represent a needed situation, larger weights on other observations may not solve that gap. Very large weights can make a few records dominate, so inspect their quality. Training weights and evaluation weights should be distinguished and chosen to answer clearly stated questions.
Business use
Weighted training sets help teams express which errors or observations matter within a learning objective. They are useful only when the weighting policy has a defensible purpose.
Record the weight source, normalization, and treatment of missing or zero values. Keep weights aligned with their examples when splitting or shuffling data. Check that the selected learner actually accepts and uses them as intended. Evaluate both the targeted objective and relevant unweighted or subgroup measures, so gains in one view do not hide deterioration elsewhere.
People also ask
Are example weights learned model parameters?
Usually not in this context. They specify example influence, while model parameters determine predictions.
Must weights sum to one?
Not necessarily. A normalized weighted mean divides by their total, while some algorithms explicitly require a distribution.
Does repeating a row equal weighting it?
Integer repetition can match certain additive objectives, but optimization details, normalization, and stochastic procedures can make practical behavior differ.
Check your understanding
Why does the best constant move from 4 to 8.2 after weighting the target 10 more heavily?
Answer: The weighted objective penalizes errors on that observation eight times as much as errors on either of the others, shifting the minimizing weighted mean toward 10.
Related terms
- Boosting
- Regularization
- Sample weight
- Weighted loss
- Weighted mean
- AdaBoost
- Class imbalance
- Importance weighting
- Cost-sensitive learning
Learn next
Replace the weights with 1, 1, and 2. The optimal constant becomes 5.5. Calculate its normalized weighted squared error, then compare the prediction with 4 and 8.2. Explain the change in emphasis without claiming that any one weighting is universally correct.
More in Graphs and symbolic AI
- Type signature - A type signature specifies the types of inputs and outputs associated with a function or operation.
- UCB1 - UCB1 is a multi-armed bandit algorithm that selects an action using its average observed reward plus an exploration bonus.
- UCT - UCT is a method for guiding Monte Carlo tree search by applying upper-confidence-bound ideas at decision nodes.
- Łukasiewicz logic - Łukasiewicz logic is a family of many-valued logics associated with Jan Łukasiewicz.
- Unary constraint - A unary constraint is a rule that restricts the allowed values of one variable in a constraint satisfaction problem.
- Unbounded cost search - Unbounded-cost search seeks a valid solution without requiring its cost to fall below a specified threshold or within a specified factor of the best...
Sources
Primary sources: AIMA original weighted-training-set context: https://raw.githubusercontent.com/aimacode/aima-glossary/master/sentences.txt ; Robert Schapire, Theoretical Views of Boosting, example distributions and updates: https://www.schapire.net/papers/Schapire99.pdf . The constant-regression calculation is original.
Previous: Weighted sum Next: Weighted zone scoring