A weighted sum combines inputs by scaling each value with a coefficient and adding the results. For scalar inputs x₀,…,xₙ with weights w₀,…,wₙ, it has the form w₀x₀ + … + wₙxₙ; a model commonly adds a bias b. The weights determine how strongly each input affects the output, while the bias shifts that output independently of the inputs. section 1.1 section 2.9.1
In a simple prediction model, a weighted sum turns features into a score. Hardness and sharpness, for example, can be combined into a threat score y = w₀·hardness + w₁·sharpness + b. A threshold can then turn the score into a decision. The weights are initially unknown and are estimated during model training; using the fitted model on new inputs is inferencing. section 1.1
| y(hardness, sharpness) = w0 × hardness + w1 × sharpness + b |
This equation makes the role of each term explicit: every feature is multiplied by its own weight, then the bias is added. section 1.1
From score to a cat decision
With low hardness and sharpness, the example produces a negative threat score and “approach and purr.” Midrange values produce a score near zero and “ignore,” while high values produce a positive score and “run away.” The same formula therefore expresses a gradual numerical estimate before a discrete decision is made. section 1.1
For vectors, the same idea is called a linear combination: α₁v₁ + α₂v₂ + … + αₙvₙ. Linear combinations connect algebra to geometry. A vector-space basis spans a space because every vector in that space can be written as a linear combination of basis vectors. Conversely, a set is linearly dependent when nonzero weights can combine its vectors to produce the zero vector. section 2.9.1 section 2.9.3
Weighted sums recur in machine learning and probability:
- A weighted sum alone defines a linear model and yields a linear decision boundary; applying a sigmoid to that sum creates a nonlinear building block for neural networks. section 1.6
- A perceptron weights binary inputs, adds a bias, and applies an activation; suitable weights and bias can implement logical AND, OR, and NOT behavior. section 7.3.4
- An expected value is a weighted sum of possible random-variable values, using occurrence probabilities as weights; variance similarly weights squared distances from the mean. section 5.10
A weighted sum is simple enough to interpret term by term, but its limits matter. When classes cannot be separated by a line, changing weights cannot make the linear form capture the needed curved separator. Nonlinear functions, such as a sigmoid applied after the sum, extend what the model can represent. section 1.6



