Weighted average
A weighted average is a mean in which each value contributes in proportion to its assigned numerical weight.
Grokking Machine Learning, Second Edition
A weighted average is an average in which each value contributes according to an assigned weight.
- How it is used
- Chooses decision-tree splits fairly when their resulting leaves contain different numbers of samples.
- How deep it goes
- Explains weighting procedurally through leaf proportions and resulting Gini index and entropy values without giving a general formula.
- Examples
- Uses an eight-sample dataset split into leaves of six and two samples.
- What you can do after
- Evaluate/understand unequal-size decision-tree splits by weighting each leaf’s Gini impurity or entropy by its sample proportion.
Read how Grokking Machine Learning, Second Edition explains weighted average →
Experimentation for Engineers
A weighted average is an average in which each value contributes in proportion to an assigned weight.
- How it is used
- Uses weighted averages to estimate CPU time at unmeasured parameter values during experimental optimization.
- How deep it goes
- Defines normalization and proximity weighting, then connects them to squared-exponential kernels and a Gaussian-process implementation.
- Examples
- Works through CPU-time measurements at parameters 0.5 and 0.0, estimating values near 0.4 and 0.25.
- What you can do after
- Apply it via NumPy to construct proximity-weighted estimates from measured parameter–outcome pairs.
Read how Experimentation for Engineers explains weighted average →
Math for Web Design
A weighted average is an average in which each value contributes according to an assigned numerical weight.
- How it is used
- Uses weighted contributions to calculate grayscale colors, transparency results, and smooth animation paths.
- How deep it goes
- Explains coefficients and formulas through color and animation examples, without developing weighted-average theory beyond these applications.
- Examples
- Demonstrates RGB grayscale coefficients, a half-transparent blue square over red, and quadratic Bézier control-point weighting.
- What you can do after
- Apply weighted calculations to build grayscale colors, understand transparency results, and interpret Bézier animation paths.
Inside Deep Learning: Math, Algorithms, Models
An average in which each term is multiplied by a weight before summation.
- How it is used
- Combines item-level feature representations into one bag representation using attention weights.
- How deep it goes
- Defines the weighted-sum formula and describes aligning tensor shapes for pairwise multiplication.
- Examples
- Uses a bag of three MNIST digits to illustrate attention weights over item feature vectors.
- What you can do after
- Build it from scratch in PyTorch by pairing feature-extraction and weight-selection networks in a combiner.
Read how Inside Deep Learning: Math, Algorithms, Models explains weighted average →
Deep Learning with R, Third Edition
A weighted average is an average in which each value contributes according to an associated numerical weight.
- How it is used
- Combines classifier predictions at inference time to form a stronger ensemble result.
- How deep it goes
- Explains unequal prediction weights and validation-set optimization, but does not provide a mathematical derivation.
- Examples
- Uses four classifier prediction vectors combined with weights of 0.5, 0.25, 0.1, and 0.15.
- What you can do after
- Apply weighted averaging to classifier predictions and tune weights on validation data with random search or Nelder–Mead.
Read how Deep Learning with R, Third Edition explains weighted average →
Deep Learning with Python, Third Edition
An averaging operation that assigns different weights to different values before combining them into a single result.
- How it is used
- Combines classifier predictions at inference time to build an ensemble.
- How deep it goes
- Defines equal and learned weighting, demonstrates implementation, and stops short of deriving the optimization algorithms.
- Examples
- Uses four classifier prediction arrays with equal weights and with weights of 0.5, 0.25, 0.1, and 0.15.
- What you can do after
- Apply it via validation-data weight optimization to combine classifier predictions into a strong ensemble baseline.
Read how Deep Learning with Python, Third Edition explains weighted average →
Also covered in
- Grokking Statistics
- Local Image GenerationIn early access (MEAP)
- Rust in Action: Systems programming concepts and techniques
- Outlier Detection in Python
- Statistics Every Programmer Needs
What to know first
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- noiseNoise is variation, information, or content that is random, irrelevant, or unwanted relative to a signal, pattern, measurement, or task.
Related concepts
- checkpoint mergingused by · Checkpoint merging is the technique of combining parameters from multiple model checkpoints according to specified proportions to create a new model.
- accuracyconfigured by · Accuracy is the degree to which a result agrees with a specified truth, reference, or criterion, commonly measured as the proportion of evaluated predictions that are correct.
- inner productequivalent to · An inner product is a scalar-valued operation on two vectors that generalizes the dot product, which for real coordinate vectors is the sum of products of corresponding components.
- Gaussian mixture modelused by · A Gaussian mixture model is a probabilistic model that represents a distribution as a weighted combination of Gaussian component distributions.
- exponential moving averageused by · A recursively updated average that combines new values with a prior average using exponentially declining weights, giving newer values greater influence.
Questions about weighted average
What is weighted average?
A weighted average is a mean in which each value contributes in proportion to its assigned numerical weight.
Which Manning books explain weighted average?
Grokking Machine Learning, Second Edition, Experimentation for Engineers, Math for Web Design, Inside Deep Learning: Math, Algorithms, Models, Deep Learning with R, Third Edition and Deep Learning with Python, Third Edition.
What should I know before learning weighted average?
Manning books that teach weighted average usually introduce language model and noise first.
What is weighted average also called?
Weighted average is also called weighted mean.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





