paddlets.transform.statistical
- class StatsTransform(cols: Union[str, List], start: int = 0, end: int = 1, statistics: List = ['median', 'mean', 'max', 'min', 'std'])[source]
Bases:
BaseTransformStatistical features: ‘median’, ‘mean’, ‘max’, ‘min’, ‘std’
- Parameters
cols (str|List) – Name of columns to transform.
start (int) – Start coordinates.
end (int) – End coordinates.
statistics (str|List) – Indicators that need to be counted, default=[‘median’, ‘mean’, ‘max’, ‘min’, ‘std’].
- Returns
None
Examples
Given X: X 1 2 3 4 statistics = ['mean'], start = 0, end = 2 after transform: X X_mean 1 nan 2 1.5 3 2.5 4 3.5 Remark: since the first element(1) start index has no value, the result of calculating the mean is nan statistics = ['mean'], start = 1, end = 3 after transform: X X_mean 1 nan 2 nan 3 1.5 4 2.5