Standardize

class of dascore.proc.basic
inherits from: PatchProcessor, DascoreBaseModel, pydantic.main.BaseModel
source

Standardize(
    *args ,
    dim: str ,
)-> None

Standardize data by removing the mean and scaling to unit variance.

The standard score of a sample x is calculated as:

z = (x - u) / s where u is the mean of the training samples or zero if with_mean=False, and s is the standard deviation of the training samples or one if with_std=False.

NaN values are ignored when computing the mean and standard deviation. They remain NaN in the output but do not affect any other sample.

Parameters

Parameter Description
dim The dimension along which the normalization takes place.

Examples

import dascore as dc

patch = dc.get_example_patch()

# standardize along the time axis
standardized_time = patch.standardize('time')

# standardize along the x axis
standardized_distance = patch.standardize('distance')

```

Methods

Name Description
check Refuse a patch which does not carry what the operation needs.
derive Return the result’s metadata, as a patch without data.
kernel Return the data centred and scaled along its dimension.
new Create new instance with some attributed updated.
standardize Standardize data by removing the mean and scaling to unit variance.
plan Return the axis to standardize along.
reconcile Return the result’s metadata once the data are known; default as is.
run Run the operation: check, derive, plan, kernel, reconcile, record.