ML – Standard deviation and Variance

Standard deviation is a number that describes how spread out the values are.
A low standard deviation means that most of the numbers are close to the mean (average) value.
A high standard deviation means that the values are spread out over a wider range.

Example: This time we have registered the speed of 7 cars:

import numpy

speed = [86,87,88,86,87,85,86]

x = numpy.std(speed)

print(x)

0.9035079029052513


import numpy

speed = [32,111,138,28,59,77,97]

x = numpy.std(speed)

print(x)

37.84501153334721

# Find the Variance
import numpy

speed = [32,111,138,28,59,77,97]

x = numpy.var(speed)

print(x)

1432.2448979591834

import numpy

speed = [86,87,88,86,87,85,86]

x = numpy.var(speed)

print(x)

0.8163265306122449

Symbols
Standard Deviation is often represented by the symbol Sigma: σ
Variance is often represented by the symbol Sigma Square: σ2

Advertisement