balance#

tangles.util.preprocessing.balance(data: ndarray, axis: int) ndarray#

Each data vector, along the specified axis, gets its median subtracted from it. This causes half of the values to be positive and half to be negative.

Parameters#

data

the data to balance.

axis

the axis along which to balance.

Returns#

np.ndarray

balanced_data.