nimble.calculate.meanNormalize¶
- nimble.calculate.meanNormalize(values1, values2=None)¶
Subtract the vector mean from each element.
Normalization of
values1is calculated by subtracting the mean ofvalues1from each element. The mean ofvalues1is also subtracted from each element invalues2, when applicable. This normalization is also known as “Centered” or “Centering”.Examples
>>> lst1 = [[1], [2], [3], [4], [5]] >>> X1 = nimble.data(lst1) >>> meanNormalize(X1) <Matrix 5pt x 1ft 0 ┌─────── 0 │ -2.000 1 │ -1.000 2 │ 0.000 3 │ 1.000 4 │ 2.000 > >>> lst2 = [[3], [2], [6]] >>> X2 = nimble.data(lst2) >>> norm1, norm2 = meanNormalize(X1, X2) >>> norm2 <Matrix 3pt x 1ft 0 ┌─────── 0 │ 0.000 1 │ -1.000 2 │ 3.000 >