
Variance
Variance is a measure of how far a set of numbers is spread out from their average value. It is calculated as the average of the squared differences from the Mean.
For example, if we have the following set of numbers: 2, 4, 4, 4, 5, 5, 7 and 8, the mean is 5. To calculate the variance we have to subtract the mean from each value and square the result.
The formula for variance is:
Variance = ((2-5)^2 + (4-5)^2 + (4-5)^2 + (4-5)^2 + (5-5)^2 + (5-5)^2 + (7-5)^2 + (8-5)^2 ) / (n-1)
In the example above, the variance is 4.
Variance is a useful measure in statistics to quantify the spread of data. It is also used in machine learning algorithms to measure the performance of models.