timeflux.nodes.ml


Machine Learning

ml

timeflux.nodes.ml.IDLE = 0
timeflux.nodes.ml.ACCUMULATING = 1
timeflux.nodes.ml.FITTING = 2
timeflux.nodes.ml.READY = 3
class timeflux.nodes.ml.Pipeline(steps=None, fit=True, mode='predict', meta_label=('epoch', 'context', 'target'), event_start_accumulation='accumulation_starts', event_stop_accumulation='accumulation_stops', event_start_training='training_starts', event_reset=None, buffer_size='5s', passthrough=False, resample=False, resample_direction='right', resample_rate=None, warmup=None, model=None, cv=None)[source]

Bases: timeflux.core.node.Node

Fit, transform and predict.

Training on continuous data is always unsupervised. Training on epoched data can either be supervised or unsupervised.

If fit is False, input events are ignored, and initital training is not performed. Automatically set to False if mode is either ‘fit_predict’ or fit_transform’. Automatically set to True if mode is either ‘predict’, ‘predict_proba’ or ‘predict_log_proba’.

Variables:
  • i (Port) – Continuous data input, expects DataFrame.

  • i_* (Port) – Epoched data input, expects DataFrame.

  • i_training (Port) – Continuous training data input, expects DataFrame.

  • i_training_* (Port) – Epoched training data input, expects DataFrame.

  • i_events (Port) – Event input, expects DataFrame.

  • o (Port) – Continuous data output, provides DataFrame.

  • o_* (Port) – Epoched data output, provides DataFrame.

  • o_events (Port) – Event output, provides DataFrame.

Parameters:
  • steps (dict) – Pipeline steps and settings (ignored if ‘model’ is set)

  • fit (bool) –

  • mode ('predict'|'predict_proba'|'predict_log_proba'|'transform'|'fit_predict'|'fit_transform') –

  • meta_label (str|tuple|None) –

  • event_start_accumulation (str) –

  • event_stop_accumulation (str) –

  • event_start_training (str) –

  • event_reset (str) –

  • buffer_size (str) –

  • passthrough (bool) –

  • resample (bool) –

  • resample_direction ('right'|'left'|'both') –

  • resample_rate (None|float) –

  • warmup (str) – Load a .npy or .npz file and bootstrap the model with initial data

  • model (str) – Load a pre-computed model, persisted with joblib

  • cv – Cross-validation - NOT IMPLEMENTED

Instantiate the node.

update()[source]

Update the input and output ports.

terminate()[source]

Perform cleanup upon termination.