skbio.stats.composition.
centralize
(mat)[source]¶Center data around its geometric average.
State: Experimental as of 0.4.0.
Parameters: | mat (array_like, float) – a matrix of proportions where rows = compositions and columns = components |
---|---|
Returns: | centered composition matrix |
Return type: | numpy.ndarray |
Examples
>>> import numpy as np
>>> from skbio.stats.composition import centralize
>>> X = np.array([[.1,.3,.4, .2],[.2,.2,.2,.4]])
>>> centralize(X)
array([[ 0.17445763, 0.30216948, 0.34891526, 0.17445763],
[ 0.32495488, 0.18761279, 0.16247744, 0.32495488]])