Shufflers
Shufflers
Shufflers are helpers classes used by the iterator to change the order of the run-to-failure cycles and the timestamps inside each cycle
There are six types of shuffles
- NotShuffled: All the cycles are processed in order
- AllShuffled: Everything is shuffled
- IntraTimeSeriesShuffler: Each point of the time series is shuffled, but the TS are kept in order
- InverseOrder: The data points will be fed in RUL decreasing order
- TimeSeriesOrderIntraSignalShuffling: Each point in the ts is shuffled, and the ts order are shuffled also.
- TimeSeriesOrderShuffling: Time series are shuffled, but each point inside the time series kept its order
AbstractShuffler
A Shuffler is used by the iterator to interleave samples of different run-to-fail cycles
Source code in ceruleo/iterators/shufflers.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 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 91 92 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 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
advance()
at_end()
Determines weather the iterator reached to its end
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
Wether the iterator is at its end |
initialize(iterator)
Initialize the current shuffler
This method is in charge of initializing everything to allow the correct iteration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
iterator |
WindowedDatasetIterator
|
WindowedDatasetIterator |
required |
Source code in ceruleo/iterators/shufflers.py
next_element()
Iterating function
The method takes the current time serie, and the current time stamp and calls the advance method
Returns:
Type | Description |
---|---|
Tuple[int, int]
|
Index of the current run-to-failure cycle andcurrent timestamp of that cycle |
Source code in ceruleo/iterators/shufflers.py
number_of_samples_of_current_time_series()
Obtain the number of samples for the current time series
Returns:
Type | Description |
---|---|
int
|
Number of samples |
Source code in ceruleo/iterators/shufflers.py
start(iterator)
Start the shuffler given an iterator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
iterator |
WindowedDatasetIterator
|
An Windowed Iterator |
required |
time_series()
AllShuffled
Bases: AbstractShuffler
Everything is shuffled
Iteration 1: | TS 1 | TS 2 | TS 2 | TS 1 | TS 1 | TS 2
| 3 | 2 | 1 | 1 | 2 | 3
Source code in ceruleo/iterators/shufflers.py
IntraTimeSeriesShuffler
Bases: AbstractShuffler
Each point of the time series is shuffled, but the TS are kept in order
Iteration 1: | TS 1 | TS 1 | TS 1 | TS 2 | TS 2 | TS 2
| 3 | 1 | 2 | 2 | 3 | 1
Iteration 2: | TS 1 | TS 1 | TS 1 | TS 2 | TS 2 | TS 2
| 1 | 3 | 2 | 3 | 2 | 1
Source code in ceruleo/iterators/shufflers.py
InverseOrder
Bases: AbstractShuffler
The data points will be fed in RUL decreasing order
Iteration 1: | TS 2 | TS 1 | TS 2 | TS 1 | TS 2 | TS 1
| 4 | 3 | 3 | 2 | 2 | 1
Source code in ceruleo/iterators/shufflers.py
NotShuffled
Bases: AbstractShuffler
Nothing is shuffled. Each sample of each run-to-failure cycle are iterated in order
Iteration 1: | Life 1 | Life 1 | Life 1 | Life 2 | Life 3 | Life 3
| 1 | 2 | 3 | 1 | 2 | 1
Iteration 2: | Life 1 | Life 1 | Life 1 | Life 2 | Life 3 | Life 3
| 1 | 2 | 3 | 1 | 2 | 1
Source code in ceruleo/iterators/shufflers.py
TimeSeriesOrderIntraSignalShuffling
Bases: AbstractShuffler
Each point in the ts is shuffled, and the ts order are shuffled also.
!!! note
Iteration 1: | TS 1 | TS 1 | TS 1 | TS 2 | TS 2 | TS 2
| 3 | 2 | 1 | 1 | 3 | 2
Iteration 2: | TS 2 | TS 2 | TS 2 | TS 1 | TS 1 | TS 1
| 3 | 1 | 2 | 3 | 1 | 2
Source code in ceruleo/iterators/shufflers.py
TimeSeriesOrderShuffling
Bases: AbstractShuffler
Time series are shuffled, but each point inside the time series kept its order
Iteration 1: | TS 1 | TS 1 | TS 1 | TS 2 | TS 2 | tS 2 |
| 1 | 2 | 3 | 1 | 2 | 3 |
Iteration 2: | TS 2 | TS 2 | TS 2 | TS 1 | TS 1 | TS 1 |
| 1 | 2 | 3 | 1 | 2 | 3 |