normalise
- MPPData.normalise(background_value=None, percentile=None, rescale_values=None)[source]
Normalise
MPPData.mppvalues.This operation is performed in place.
- Parameters
background_value (
Union[float,List[float],str,None]) –Shift all values by that value. All resulting negative values are cut off at zero. Several shift options are possible, depending on a background_value, which could be in one of the following formats:
single value (float): then data is shifted by this number in every channels
list of predefined values (list of float): data in each channel is shifted separately by a corresponding value in that list. Note: in that case, number of shifted values should be the same as number of channels.
string: list of values for shifting are loaded from the channels_metadata table (should be located in
data_config.DATA_DIRin a filedata_config.CHANNELS_METADATA). The values are then loaded from the column corresponding to a provided string value.
percentile (
Optional[float]) – Rescale the data using the specified percentile. Modifiesrescale_valuesas a side effect with the calculated percentiles.rescale_values (
Optional[List[float]]) – Can optionally contain previously calculated percentiles that will be used to rescale the data, instead of calculating percentiles again. This is useful for using the same values to scale e.g. train and test sets. If an empty list is passed, this will be filled with the percentiles calculated on this data.
- Return type
Nothing, updates MPPData.mpp in place.