Pipeline
Pipeline
Pipeline
Bases: BaseEstimator
, TransformerMixin
Transformation pipeline
Parameters:
Name | Type | Description | Default |
---|---|---|---|
final_step |
The final step of the transformation |
required | |
cache_type |
CacheStoreType
|
Cache storage mode |
MEMORY
|
Source code in ceruleo/transformation/functional/pipeline/pipeline.py
15 16 17 18 19 20 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 |
|
find_node(name)
Find a transformation node given a name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the step to find |
required |
steps: Steps located in the pipeline.
Source code in ceruleo/transformation/functional/pipeline/pipeline.py
fit(dataset, show_progress=False)
Fit a pipeline using a dataset
The CachedPipelineRunner is called to fit
Parameters:
dataset: A dataset of a run-to-failure cycle
show_progress: Wether to show the progress when fitting
Returns:
Name | Type | Description |
---|---|---|
s |
Pipeline |
Source code in ceruleo/transformation/functional/pipeline/pipeline.py
transform(df)
Transform a run-to-cycle failure or a dataset
The CachedPipelineRunner is called to transform
Parameters:
df: A dataset of a run-to-failure cycle
Returns:
Name | Type | Description |
---|---|---|
s |
list of data frames |
Source code in ceruleo/transformation/functional/pipeline/pipeline.py
make_pipeline(*steps, cache_type=CacheStoreType.MEMORY)
Build a pipeline
Example:
make_pipeline(
ByNameFeatureSelector(features=FEATURES),
Clip(lower=-2, upper=2),
IndexMeanResampler(rule='500s')
)
Parameters:
steps: List of steps
cache_type: Where to store the pipeline intermediate steps
Returns:
TemporisPipeline: The created pipeline
Source code in ceruleo/transformation/functional/pipeline/pipeline.py
Cache
CacheStoreType
GraphTraversalAbstractStore
Abstract Cache for the graph traversal
Source code in ceruleo/transformation/functional/pipeline/cache_store.py
GraphTraversalCacheMemory
Cache all the intermediate steps in RAM
Source code in ceruleo/transformation/functional/pipeline/cache_store.py
GraphTraversalCacheShelveStore
Cache all the intermediate steps in a Shelve Store
Parameters:
cache_path: Path where the case is stored
Source code in ceruleo/transformation/functional/pipeline/cache_store.py
Cache
CachedPipelineRunner
Performs an execution of the transformation graph caching the intermediate results
Parameters:
final_step: Last step of the graph
cache_type: Mode for storing the cache
Source code in ceruleo/transformation/functional/pipeline/runner.py
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 |
|
Traversal
CachedGraphTraversal
Iterator for a graph nodes.
The cache data structures has the following form Current Node -> Previous Nodes -> [Transformed Dataset]
- cache[n]: contains a dict with one key for each previous node
- cache[n][n.previous[0]] A list with each element of the dataset transformed in up to n.previous[0]
Parameters:
root_nodes: Initial nodes of the graph
dataset: Each node visit the dataset
cache_path: Where to store the cache
cache_type: Mode for storing the intermediate steps
Source code in ceruleo/transformation/functional/pipeline/traversal.py
13 14 15 16 17 18 19 20 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 |
|
Utils
plot_pipeline(pipe, name)
Plot the transformation pipeline
Parameters:
pipe: The pipeline
name: Title of the graphic
Returns:
graphic: the diagram