Basic Functions

class sekupy.preprocessing.functions.Detrender(degree=1, chunks_attr='chunks', **kwargs)[source]

Detrend data.

Parameters:
  • degree (int, optional) – The polynomial degree of the detrending function (the default is 1)

  • chunks_attr (str, optional) – The attribute used to get data for the detrend (the default is ‘chunks’, which can be only a sample attribute of the dataset)

transform(ds)[source]

Detrend the dataset.

Parameters:

ds (Dataset) – The dataset to be detrended.

Returns:

ds – The detrended dataset

Return type:

Dataset

class sekupy.preprocessing.functions.FeatureStacker(stack_attr=['chunks'], keep_attr=['targets'], selection_dictionary={}, **kwargs)[source]

Stack features.

This function is used to stack features with different sample attribute keys, to use these features, jointly.

Parameters:
  • stack_attr (list, optional) –

    This is the attribute to be used for stacking, the resulting dataset will have a sample attribute given by the union of unique attributes

    (the default is ‘chunks’)

  • keep_attr (list, optional) – The attributes to keep, unique values of these attributes will be used to mask the dataset. (the default is [‘targets’])

  • selection_dictionary (dict, optional) – This will be used to filter the dataset see `SampleSlicer`.

transform(ds)[source]

Transform the provided dataset.

This method applies the transformation to the dataset and records the transformation in the dataset’s preprocessing history.

Parameters:

ds (Dataset) – The dataset to transform

Returns:

The transformed dataset

Return type:

Dataset

update_attribute(ds, ds_orig)[source]
class sekupy.preprocessing.functions.Resampler(up=1, down=1)[source]
transform(ds)[source]

Transform the provided dataset.

This method applies the transformation to the dataset and records the transformation in the dataset’s preprocessing history.

Parameters:

ds (Dataset) – The dataset to transform

Returns:

The transformed dataset

Return type:

Dataset

class sekupy.preprocessing.functions.SampleAttributeTransformer(attr=None, fx=None, **kwargs)[source]
transform(ds)[source]

Transform the provided dataset.

This method applies the transformation to the dataset and records the transformation in the dataset’s preprocessing history.

Parameters:

ds (Dataset) – The dataset to transform

Returns:

The transformed dataset

Return type:

Dataset

class sekupy.preprocessing.functions.SampleAverager(attributes)[source]

Init the transformer.

Parameters:

attributes (list) – List of sample attributes whose unique values will be used to identify the samples groups.

transform(ds)[source]

Average samples.

Parameters:

ds (Dataset) – The dataset to be transformed.

Returns:

ds – The transformed dataset

Return type:

Dataset

class sekupy.preprocessing.functions.SampleTransformer(attr={})[source]

Transforms samples.

This function is used when we need to lock SampleSlicer with TargetTransformer in order to be used with AnalysisIterator.

Parameters:

attr (dictionary) – [description]

Returns:

[description]

Return type:

[type]

transform(ds)[source]

Transform the provided dataset.

This method applies the transformation to the dataset and records the transformation in the dataset’s preprocessing history.

Parameters:

ds (Dataset) – The dataset to transform

Returns:

The transformed dataset

Return type:

Dataset

class sekupy.preprocessing.functions.TargetTransformer(attr='targets', fx=None, **kwargs)[source]
transform(ds)[source]

Transform the provided dataset.

This method applies the transformation to the dataset and records the transformation in the dataset’s preprocessing history.

Parameters:

ds (Dataset) – The dataset to transform

Returns:

The transformed dataset

Return type:

Dataset

class sekupy.preprocessing.functions.TemporalTransformer(attr='frame')[source]
Parameters:

attr (dictionary) – [description]

Returns:

[description]

Return type:

[type]

transform(ds)[source]

Transform the provided dataset.

This method applies the transformation to the dataset and records the transformation in the dataset’s preprocessing history.

Parameters:

ds (Dataset) – The dataset to transform

Returns:

The transformed dataset

Return type:

Dataset