def standarize( trainingset ):
    """
    Morph the input signal to a mean of 0 and scale the signal strength by 
    dividing with the standard deviation (rather that forcing a [0, 1] range)
    """
    
    def encoder( dataset ):
        manipulated_dataset = copy.deepcopy( dataset )
        for instance in manipulated_dataset:
            instance.features = (instance.features - means) / stds
        return manipulated_dataset
    #end
    
    training_data = np.array( [instance.features for instance in trainingset ] )
    means = training_data.mean(axis=0)
    stds = training_data.std(axis=0)
    
    return encoder
#end
dataset/ETHPy150Open jorgenkg/python-neural-network/src/preprocessing.py/standarize/original