mlpy.auxiliary.array.normalize¶
-
mlpy.auxiliary.array.
normalize
(a, axis=None, return_scale=False)[source]¶ Normalize the input array to sum to 1.
Parameters: a : array_like, shape (nsamples, nfeatures)
Non-normalized input data array.
axis : int
Dimension along which normalization is performed.
Returns: array_like, shape (nsamples, nfeatures) :
An array with values normalized (summing to 1) along the prescribed axis.
Examples
>>>
Attention
The input array a is modified inplace.