pasteur.transform.SeqTransformer#
- class pasteur.transform.SeqTransformer(**_)[source]#
Sequence Transformers are a generalised version of Reference Transformers that can be used to process event data.
Sequence Transformers receive unprocessed parent columns, references and the ID table. Then, it is up to them to process the data and return the encoded version. They can also push columns upstream to parents, through context tables.
Event-based data is sequential. The Sequential transformers may require the order of each row. For this case, the main Sequence Transformer, which is named the sequencer, is processed first and returns an additional data column and attribute during fitting. This column and attribute are fed to the other sequence transformers.
Attributes
For a given output, the input is the same.
The decoded output equals the input.
Transformer fits variables.
Methods
fit(table, data[, ref, ids, seq_val, seq])Fits to the provided data
fit_transform(table, data[, ref, ids, ...])get_factory(*args, **kwargs)Returns a factory that registers this module to the system.
reduce(other)reverse(data, ctx[, ref, ids])When reversing, the data column contains encoded data, whereas the ref column contains decoded/original data.
transform(data[, ref, ids, seq])- deterministic = True#
For a given output, the input is the same.
- fit(table, data, ref=None, ids=None, seq_val=None, seq=None)[source]#
Fits to the provided data
- Return type:
tuple[SeqValue,Series] |None
- fit_transform(table, data, ref=None, ids=None, seq_val=None, seq=None)[source]#
- Return type:
tuple[DataFrame,dict[str,DataFrame]] |tuple[DataFrame,dict[str,DataFrame],Series]
- classmethod get_factory(*args, **kwargs)#
Returns a factory that registers this module to the system.
Any *args and **kwargs passed to this function will be saved and passed to the module’s __init__() method when calling build().
- lossless = True#
The decoded output equals the input.
-
name:
str#
- reverse(data, ctx, ref=None, ids=None)[source]#
When reversing, the data column contains encoded data, whereas the ref column contains decoded/original data. Therefore, the referred columns have to be decoded first.
- Return type:
DataFrame
- stateful = False#
Transformer fits variables.