-
Notifications
You must be signed in to change notification settings - Fork 1
[Abstract] PipelineUnit
A Pipeline Unit 📦 is any class able to be part of a Pipeline of processes. These can be filters, denoisers, segmenters, machine learning trainers, decision modules, etc. You may find these Pipeline Units implemented in various modules:
-
Filter from
processing
-
Segmenter from
processing
-
Feature Extractor from
features
-
Feature Selector from
features
-
Supervising Trainer from
ml
-
Decision Maker from
decisions
PipelineUnit is an abstract class, meaning objects cannot be instantiated from it. You need to instantiate one of its subclasses (from above), corresponding to the behavior you need. Each of these has its own initializer, so, to instantiate one of them, just follow its signature.
Just call its apply
method and give what it requires.
pipeline_unit.apply(...)
The parameters are different depending on the Pipeline Unit, but, usually, they are collections of Timeseries.
Go on, create any agent you would like to process and analyse Biosignals . Create event detectors, segment excluders, quality analysers, whatever you need for your research. Create a class that inherits from PipelineUnit
, implement n initializer and the apply
method. The apply
method works as the executor of the Command Design Pattern, where a Pipeline calls the apply
of every PipelineUnit
.
Extend the functionality of a concrete PipelineUnit, such as filters and machine learning trainers.
class MySupervisingTrainer(SupervisingTrainer):
# Probably the SupervisingTrainer already comes with the properties you need, you just want different behavior.
def __init(self, model, train_conditions, name):
super().__init__(model, train_conditions, name)
# Different behavior here. Override 'apply'!
def apply(self, object, target):
# TODO