trends
AdditiveLinearTrendGenerator
Bases: TrendsGenerator
Add a linear trend to the input time-series data
Source code in badgers/generators/time_series/trends.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
generate(X, y, slope, start, end)
:param X: the input signal to be transformed :param y: not changed (here for API compatibility) :param slope: (increase per time unit) :type slope: Union[float | list] :param end: :param start: :return: the transformed signal Xt (X + linear trend), and y (not changed)
Source code in badgers/generators/time_series/trends.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
GlobalAdditiveLinearTrendGenerator
Bases: TrendsGenerator
Add a linear trend to the input time-series data
Source code in badgers/generators/time_series/trends.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
generate(X, y, slope)
:param X: the input signal to be transformed :param y: not changed (here for API compatibility) :param slope: the slope of the trend (increase per time unit) :type slope: Union[float | list] :return: the transformed signal Xt (X + linear trend), and y (not changed)
Source code in badgers/generators/time_series/trends.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
RandomlySpacedLinearTrends
Bases: TrendsGenerator
Generates randomly time intervals where a linear trend is added to the signal Slopes, Tme intervals locations and widths are chosen randomly
Source code in badgers/generators/time_series/trends.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
generate(X, y, n_patterns=10, min_width_pattern=5, max_width_patterns=10, slope_min=-0.05, slope_max=0.05)
Generates randomly time intervals where a linear trend is added to the signal Slopes, Tme intervals locations and widths are chosen randomly.
:param X: :param y: :param n_patterns: the total number of time intervals where a linear trend is add :param min_width_pattern: the minimum with of the time intervals :param max_width_patterns: the maximum with of the time intervals :param slope_min: the minimum value of the slope (slope is chosen uniformly at random between min_slope and max_slope for each time interval and each column of X) :param slope_max: the maximum value of the slope (slope is chosen uniformly at random between min_slope and max_slope for each time interval and each column of X)
:return:
Source code in badgers/generators/time_series/trends.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
TrendsGenerator
Bases: GeneratorMixin
Base class for transformers that generate trends in time-series data
Source code in badgers/generators/time_series/trends.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
__init__(random_generator=default_rng(seed=0))
:param random_generator: a random number generator
Source code in badgers/generators/time_series/trends.py
17 18 19 20 21 |
|