Machine learning / Variance Calculation Using NumpyIt is the expectation of the squared deviation of a random variable from its mean in the data set.Variance =[ (x1 - mean)2 + (x2 - mean)2 + (x3 - mean)2 + ... + (xn - mean)2 ] / [n - 1] Example: Let us take a data set of some numbers Ds= [40,10,20,25,24,40,40,14,16] Number of points in the data set = 9 Variance value =[ (x1 - mean)2 + (x2 - mean)2 + (x3 - mean)2 + ... + (xn - mean)2 ] / [n - 1] = 125.135802
|