nimble.calculate.range0to1Normalize

nimble.calculate.range0to1Normalize(values1, values2=None)

Convert values to range of 0 to 1.

For values1, the formula (element - min) / (max - min) will be applied to each element, where min is its minimum value and max is its maximum value. The minimum and maximum values from values1 are also applied to the calculation for values2, when applicable. This normalization is often referred to simply as “Normalization”.

Examples

>>> lst1 = [[1], [2], [3], [4], [5]]
>>> X1 = nimble.data(lst1)
>>> range0to1Normalize(X1)
<Matrix 5pt x 1ft
       0
   ┌──────
 0 │ 0.000
 1 │ 0.250
 2 │ 0.500
 3 │ 0.750
 4 │ 1.000
>
>>> lst2 = [[3], [2], [6]]
>>> X2 = nimble.data(lst2)
>>> norm1, norm2 = range0to1Normalize(X1, X2)
>>> norm2
<Matrix 3pt x 1ft
       0
   ┌──────
 0 │ 0.500
 1 │ 0.250
 2 │ 1.250
>