tods.feature_analysis package

Submodules

tods.feature_analysis.AutoCorrelation module

tods.feature_analysis.BKFilter module

class tods.feature_analysis.BKFilter.BKFilter(*args, **kwds)

Bases: d3m.primitive_interfaces.transformer.TransformerPrimitiveBase

Filter a time series using the Baxter-King bandpass filter.

metadata

Primitive’s metadata. Available as a class attribute.

logger

Primitive’s logger. Available as a class attribute.

hyperparams

Hyperparams passed to the constructor.

random_seed

Random seed passed to the constructor.

docker_containers

A dict mapping Docker image keys from primitive’s metadata to (named) tuples containing container’s address under which the container is accessible by the primitive, and a dict mapping exposed ports to ports on that address.

volumes

A dict mapping volume keys from primitive’s metadata to file and directory paths where downloaded and extracted files are available to the primitive.

temporary_directory

An absolute path to a temporary directory a primitive can use to store any files for the duration of the current pipeline run phase. Directory is automatically cleaned up after the current pipeline run phase finishes.

Parameters
  • low (int) – Minimum period for oscillations, ie., Baxter and King suggest that the Burns-Mitchell U.S. business cycle has 6 for quarterly data and 1.5 for annual data.

  • high (int) – Maximum period for oscillations BK suggest that the U.S. business cycle has 32 for quarterly data and 8 for annual data.

  • K (int) – Lead-lag length of the filter. Baxter and King propose a truncation length of 12 for quarterly data and 3 for annual data.

  • use_columns (Set) – A set of column indices to force primitive to operate on. If any specified column cannot be parsed, it is skipped.

  • exclude_columns (Set) – A set of column indices to not operate on. Applicable only if “use_columns” is not provided.

  • return_result (Enumeration) – Should parsed columns be appended, should they replace original columns, or should only parsed columns be returned? This hyperparam is ignored if use_semantic_types is set to false.

  • use_semantic_types (Bool) – Controls whether semantic_types metadata will be used for filtering columns in input dataframe. Setting this to false makes the code ignore return_result and will produce only the output dataframe.

  • add_index_columns (Bool) – Also include primary index columns if input data has them. Applicable only if “return_result” is set to “new”.

  • error_on_no_input (Bool() – Throw an exception if no input column is selected/provided. Defaults to true to behave like sklearn. To prevent pipelines from breaking set this to False.

  • return_semantic_type (Enumeration[str]() – Decides what semantic type to attach to generated attributes’

produce(*, inputs: d3m.container.pandas.DataFrame, timeout: float = None, iterations: int = None) → d3m.primitive_interfaces.base.CallResult[d3m.container.pandas.DataFrame]

Process the testing data. :param inputs: Container DataFrame.

Returns

Container DataFrame after BKFilter.

Parameters
  • inputs – The inputs of shape [num_inputs, …].

  • timeout – A maximum time this primitive should take to produce outputs during this method call, in seconds.

  • iterations – How many of internal iterations should the primitive do.

Returns

Return type

The outputs of shape [num_inputs, …] wrapped inside CallResult.

tods.feature_analysis.DiscreteCosineTransform module

class tods.feature_analysis.DiscreteCosineTransform.DiscreteCosineTransform(*args, **kwds)

Bases: d3m.primitive_interfaces.transformer.TransformerPrimitiveBase

Compute the 1-D discrete Cosine Transform. Return the Discrete Cosine Transform of arbitrary type sequence x.

scipy documentation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.fft.dct.html#scipy.fft.dct

metadata

Primitive’s metadata. Available as a class attribute.

logger

Primitive’s logger. Available as a class attribute.

hyperparams

Hyperparams passed to the constructor.

random_seed

Random seed passed to the constructor.

docker_containers

A dict mapping Docker image keys from primitive’s metadata to (named) tuples containing container’s address under which the container is accessible by the primitive, and a dict mapping exposed ports to ports on that address.

volumes

A dict mapping volume keys from primitive’s metadata to file and directory paths where downloaded and extracted files are available to the primitive.

temporary_directory

An absolute path to a temporary directory a primitive can use to store any files for the duration of the current pipeline run phase. Directory is automatically cleaned up after the current pipeline run phase finishes.

Parameters
  • type (int) – Type of the DCT. Default is 2

  • n (int) – Length of the transformed axis of the output. If n is smaller than the length of the input, the input is cropped. If it is larger, the input is padded with zeros.

  • axis (int) – Axis over which to compute the DCT. If not given, the last axis is used.

  • norm (str) – Normalization mode. Default is None, meaning no normalization on the forward transforms and scaling by 1/n on the ifft. For norm=””ortho””, both directions are scaled by 1/sqrt(n).

  • overwrite_x (boolean) – If True, the contents of x can be destroyed; the default is False. See the notes below for more details.

  • workers (int) – Maximum number of workers to use for parallel computation. If negative, the value wraps around from os.cpu_count(). Defualt is None.

use_columns: Set

A set of column indices to force primitive to operate on. If any specified column cannot be parsed, it is skipped.

exclude_columns: Set

A set of column indices to not operate on. Applicable only if “use_columns” is not provided.

return_result: Enumeration

Should parsed columns be appended, should they replace original columns, or should only parsed columns be returned? This hyperparam is ignored if use_semantic_types is set to false.

use_semantic_types: Bool

Controls whether semantic_types metadata will be used for filtering columns in input dataframe. Setting this to false makes the code ignore return_result and will produce only the output dataframe.

add_index_columns: Bool

Also include primary index columns if input data has them. Applicable only if “return_result” is set to “new”.

error_on_no_input: Bool(

Throw an exception if no input column is selected/provided. Defaults to true to behave like sklearn. To prevent pipelines from breaking set this to False.

return_semantic_type: Enumeration[str](

Decides what semantic type to attach to generated attributes’

produce(*, inputs: d3m.container.pandas.DataFrame, timeout: float = None, iterations: int = None) → d3m.primitive_interfaces.base.CallResult[d3m.container.pandas.DataFrame]
Parameters
  • inputs – Container DataFrame

  • inputs – The inputs of shape [num_inputs, …].

  • timeout – A maximum time this primitive should take to produce outputs during this method call, in seconds.

  • iterations – How many of internal iterations should the primitive do.

Returns

Container DataFrame added with DCT coefficients in a column named ‘column_name_dct_coeff’

Returns

Return type

The outputs of shape [num_inputs, …] wrapped inside CallResult.

tods.feature_analysis.FastFourierTransform module

class tods.feature_analysis.FastFourierTransform.FastFourierTransform(*args, **kwds)

Bases: d3m.primitive_interfaces.transformer.TransformerPrimitiveBase

Compute the 1-D discrete Fourier Transform. This function computes the 1-D n-point discrete Fourier Transform (DFT) with the efficient Fast Fourier Transform (FFT) algorithm

scipy documentation : https://docs.scipy.org/doc/scipy/reference/generated/scipy.fft.fft.html#scipy.fft.fft

metadata

Primitive’s metadata. Available as a class attribute.

logger

Primitive’s logger. Available as a class attribute.

hyperparams

Hyperparams passed to the constructor.

random_seed

Random seed passed to the constructor.

docker_containers

A dict mapping Docker image keys from primitive’s metadata to (named) tuples containing container’s address under which the container is accessible by the primitive, and a dict mapping exposed ports to ports on that address.

volumes

A dict mapping volume keys from primitive’s metadata to file and directory paths where downloaded and extracted files are available to the primitive.

temporary_directory

An absolute path to a temporary directory a primitive can use to store any files for the duration of the current pipeline run phase. Directory is automatically cleaned up after the current pipeline run phase finishes.

Parameters
  • n (int) – Length of the transformed axis of the output. If n is smaller than the length of the input, the input is cropped. If it is larger, the input is padded with zeros.

  • axis (int) – Axis over which to compute the FFT. If not given, the last axis is used.

  • norm (str) – Normalization mode. Default is None, meaning no normalization on the forward transforms and scaling by 1/n on the ifft. For norm=””ortho””, both directions are scaled by 1/sqrt(n).

  • overwrite_x (boolean) – If True, the contents of x can be destroyed; the default is False. See the notes below for more details.

  • workers (int) – Maximum number of workers to use for parallel computation. If negative, the value wraps around from os.cpu_count(). Defualt is None.

use_columns: Set

A set of column indices to force primitive to operate on. If any specified column cannot be parsed, it is skipped.

exclude_columns: Set

A set of column indices to not operate on. Applicable only if “use_columns” is not provided.

return_result: Enumeration

Should parsed columns be appended, should they replace original columns, or should only parsed columns be returned? This hyperparam is ignored if use_semantic_types is set to false.

use_semantic_types: Bool

Controls whether semantic_types metadata will be used for filtering columns in input dataframe. Setting this to false makes the code ignore return_result and will produce only the output dataframe.

add_index_columns: Bool

Also include primary index columns if input data has them. Applicable only if “return_result” is set to “new”.

error_on_no_input: Bool(

Throw an exception if no input column is selected/provided. Defaults to true to behave like sklearn. To prevent pipelines from breaking set this to False.

return_semantic_type: Enumeration[str](

Decides what semantic type to attach to generated attributes’

produce(*, inputs: d3m.container.pandas.DataFrame, timeout: float = None, iterations: int = None) → d3m.primitive_interfaces.base.CallResult[d3m.container.pandas.DataFrame]
Parameters
  • inputs – Container DataFrame

  • inputs – The inputs of shape [num_inputs, …].

  • timeout – A maximum time this primitive should take to produce outputs during this method call, in seconds.

  • iterations – How many of internal iterations should the primitive do.

Returns

Container DataFrame added with absolute and phase value in a columns named ‘column_name_fft_abs’ and ‘column_name_fft_phse’. These values correspnd to the absolute and angle values for a complex number we get as FFT coefficients

Returns

Return type

The outputs of shape [num_inputs, …] wrapped inside CallResult.

tods.feature_analysis.HPFilter module

class tods.feature_analysis.HPFilter.HPFilter(*args, **kwds)

Bases: d3m.primitive_interfaces.transformer.TransformerPrimitiveBase

Filter a time series using the Hodrick-Prescott filter.

metadata

Primitive’s metadata. Available as a class attribute.

logger

Primitive’s logger. Available as a class attribute.

hyperparams

Hyperparams passed to the constructor.

random_seed

Random seed passed to the constructor.

docker_containers

A dict mapping Docker image keys from primitive’s metadata to (named) tuples containing container’s address under which the container is accessible by the primitive, and a dict mapping exposed ports to ports on that address.

volumes

A dict mapping volume keys from primitive’s metadata to file and directory paths where downloaded and extracted files are available to the primitive.

temporary_directory

An absolute path to a temporary directory a primitive can use to store any files for the duration of the current pipeline run phase. Directory is automatically cleaned up after the current pipeline run phase finishes.

Parameters
  • lamb (int) – The Hodrick-Prescott smoothing parameter. A value of 1600 is suggested for quarterly data. Ravn and Uhlig suggest using a value of 6.25 (1600/4**4) for annual data and 129600 (1600*3**4) for monthly data.

  • use_columns (Set) – A set of column indices to force primitive to operate on. If any specified column cannot be parsed, it is skipped.

  • exclude_columns (Set) – A set of column indices to not operate on. Applicable only if “use_columns” is not provided.

  • return_result (Enumeration) – Should parsed columns be appended, should they replace original columns, or should only parsed columns be returned? This hyperparam is ignored if use_semantic_types is set to false.

  • use_semantic_types (Bool) – Controls whether semantic_types metadata will be used for filtering columns in input dataframe. Setting this to false makes the code ignore return_result and will produce only the output dataframe.

  • add_index_columns (Bool) – Also include primary index columns if input data has them. Applicable only if “return_result” is set to “new”.

  • error_on_no_input (Bool() – Throw an exception if no input column is selected/provided. Defaults to true to behave like sklearn. To prevent pipelines from breaking set this to False.

  • return_semantic_type (Enumeration[str]() – Decides what semantic type to attach to generated attributes’

produce(*, inputs: d3m.container.pandas.DataFrame, timeout: float = None, iterations: int = None) → d3m.primitive_interfaces.base.CallResult[d3m.container.pandas.DataFrame]

Process the testing data. :param inputs: Container DataFrame.

Returns

Container DataFrame after HPFilter.

Parameters
  • inputs – The inputs of shape [num_inputs, …].

  • timeout – A maximum time this primitive should take to produce outputs during this method call, in seconds.

  • iterations – How many of internal iterations should the primitive do.

Returns

Return type

The outputs of shape [num_inputs, …] wrapped inside CallResult.

tods.feature_analysis.NonNegativeMatrixFactorization module

class tods.feature_analysis.NonNegativeMatrixFactorization.NonNegativeMatrixFactorization(*args, **kwds)

Bases: d3m.primitive_interfaces.transformer.TransformerPrimitiveBase

Calculates Latent factors of a given matrix of timeseries data

metadata

Primitive’s metadata. Available as a class attribute.

logger

Primitive’s logger. Available as a class attribute.

hyperparams

Hyperparams passed to the constructor.

random_seed

Random seed passed to the constructor.

docker_containers

A dict mapping Docker image keys from primitive’s metadata to (named) tuples containing container’s address under which the container is accessible by the primitive, and a dict mapping exposed ports to ports on that address.

volumes

A dict mapping volume keys from primitive’s metadata to file and directory paths where downloaded and extracted files are available to the primitive.

temporary_directory

An absolute path to a temporary directory a primitive can use to store any files for the duration of the current pipeline run phase. Directory is automatically cleaned up after the current pipeline run phase finishes.

Parameters
  • rank (int) – The factorization rank to achieve. Default is 30.

  • update (str) –

    Type of update equations used in factorization. When specifying model parameter update can be assigned to:”

    ’euclidean’ for classic Euclidean distance update equations,” ‘divergence’ for divergence update equations.”

    By default Euclidean update equations are used.

  • objective (str) –

    Type of objective function used in factorization. When specifying model parameter :param:`objective` can be assigned to:

    ‘fro’ for standard Frobenius distance cost function, ‘div’ for divergence of target matrix from NMF estimate cost function (KL), ‘conn’ for measuring the number of consecutive iterations in which the connectivity matrix has not changed.

    By default the standard Frobenius distance cost function is used.

  • max_iter (int) – Maximum number of factorization iterations. Note that the number of iterations depends on the speed of method convergence. Default is 30.

  • learning_rate (float) – Minimal required improvement of the residuals from the previous iteration. They are computed between the target matrix and its MF estimate using the objective function associated to the MF algorithm. Default is None.

use_columns: Set

A set of column indices to force primitive to operate on. If any specified column cannot be parsed, it is skipped.

exclude_columns: Set

A set of column indices to not operate on. Applicable only if “use_columns” is not provided.

return_result: Enumeration

Should parsed columns be appended, should they replace original columns, or should only parsed columns be returned? This hyperparam is ignored if use_semantic_types is set to false.

use_semantic_types: Bool

Controls whether semantic_types metadata will be used for filtering columns in input dataframe. Setting this to false makes the code ignore return_result and will produce only the output dataframe.

add_index_columns: Bool

Also include primary index columns if input data has them. Applicable only if “return_result” is set to “new”.

error_on_no_input: Bool(

Throw an exception if no input column is selected/provided. Defaults to true to behave like sklearn. To prevent pipelines from breaking set this to False.

return_semantic_type: Enumeration[str](

Decides what semantic type to attach to generated attributes’

produce(*, inputs: d3m.container.pandas.DataFrame, timeout: float = None, iterations: int = None) → d3m.primitive_interfaces.base.CallResult[d3m.container.pandas.DataFrame]

Produce primitive’s best choice of the output for each of the inputs.

The output value should be wrapped inside CallResult object before returning.

In many cases producing an output is a quick operation in comparison with fit, but not all cases are like that. For example, a primitive can start a potentially long optimization process to compute outputs. timeout and iterations can serve as a way for a caller to guide the length of this process.

Ideally, a primitive should adapt its call to try to produce the best outputs possible inside the time allocated. If this is not possible and the primitive reaches the timeout before producing outputs, it should raise a TimeoutError exception to signal that the call was unsuccessful in the given time. The state of the primitive after the exception should be as the method call has never happened and primitive should continue to operate normally. The purpose of timeout is to give opportunity to a primitive to cleanly manage its state instead of interrupting execution from outside. Maintaining stable internal state should have precedence over respecting the timeout (caller can terminate the misbehaving primitive from outside anyway). If a longer timeout would produce different outputs, then CallResult’s has_finished should be set to False.

Some primitives have internal iterations (for example, optimization iterations). For those, caller can provide how many of primitive’s internal iterations should a primitive do before returning outputs. Primitives should make iterations as small as reasonable. If iterations is None, then there is no limit on how many iterations the primitive should do and primitive should choose the best amount of iterations on its own (potentially controlled through hyper-parameters). If iterations is a number, a primitive has to do those number of iterations, if possible. timeout should still be respected and potentially less iterations can be done because of that. Primitives with internal iterations should make CallResult contain correct values.

For primitives which do not have internal iterations, any value of iterations means that they should run fully, respecting only timeout.

If primitive should have been fitted before calling this method, but it has not been, primitive should raise a PrimitiveNotFittedError exception.

Parameters
  • inputs – The inputs of shape [num_inputs, …].

  • timeout – A maximum time this primitive should take to produce outputs during this method call, in seconds.

  • iterations – How many of internal iterations should the primitive do.

Returns

Return type

The outputs of shape [num_inputs, …] wrapped inside CallResult.

tods.feature_analysis.SKTruncatedSVD module

class tods.feature_analysis.SKTruncatedSVD.SKTruncatedSVD(*args, **kwds)

Bases: d3m.primitive_interfaces.unsupervised_learning.UnsupervisedLearnerPrimitiveBase

Primitive wrapping for sklearn TruncatedSVD sklearn documentation

metadata

Primitive’s metadata. Available as a class attribute.

logger

Primitive’s logger. Available as a class attribute.

hyperparams

Hyperparams passed to the constructor.

random_seed

Random seed passed to the constructor.

docker_containers

A dict mapping Docker image keys from primitive’s metadata to (named) tuples containing container’s address under which the container is accessible by the primitive, and a dict mapping exposed ports to ports on that address.

volumes

A dict mapping volume keys from primitive’s metadata to file and directory paths where downloaded and extracted files are available to the primitive.

temporary_directory

An absolute path to a temporary directory a primitive can use to store any files for the duration of the current pipeline run phase. Directory is automatically cleaned up after the current pipeline run phase finishes.

Parameters
  • n_components (int) – Desired dimensionality of output data. Must be strictly less than the number of features. The default value is useful for visualisation. For LSA, a value of 100 is recommended.

  • algorithm (hyperparams.Choice) – SVD solver to use. Either “arpack” for the ARPACK wrapper in SciPy (scipy.sparse.linalg.svds), or “randomized” for the randomized algorithm due to Halko (2009).

  • use_columns (Set) – A set of column indices to force primitive to operate on. If any specified column cannot be parsed, it is skipped.

  • exclude_columns (Set) – A set of column indices to not operate on. Applicable only if “use_columns” is not provided.

  • return_result (Enumeration) – Should parsed columns be appended, should they replace original columns, or should only parsed columns be returned? This hyperparam is ignored if use_semantic_types is set to false.

  • use_semantic_types (Bool) – Controls whether semantic_types metadata will be used for filtering columns in input dataframe. Setting this to false makes the code ignore return_result and will produce only the output dataframe.

  • add_index_columns (Bool) – Also include primary index columns if input data has them. Applicable only if “return_result” is set to “new”.

  • error_on_no_input (Bool() – Throw an exception if no input column is selected/provided. Defaults to true to behave like sklearn. To prevent pipelines from breaking set this to False.

  • return_semantic_type (Enumeration[str]() – Decides what semantic type to attach to generated attributes’

fit(*, timeout: float = None, iterations: int = None) → d3m.primitive_interfaces.base.CallResult[None]

Fit model with training data. :param *: Container DataFrame. Time series data up to fit.

Returns

None

Parameters
  • timeout – A maximum time this primitive should be fitting during this method call, in seconds.

  • iterations – How many of internal iterations should the primitive do.

Returns

Return type

A CallResult with None value.

get_params() → tods.feature_analysis.SKTruncatedSVD.Params

Return parameters. :param None:

Returns

class Params

Returns

Return type

An instance of parameters.

produce(*, inputs: d3m.container.pandas.DataFrame, timeout: float = None, iterations: int = None) → d3m.primitive_interfaces.base.CallResult[d3m.container.pandas.DataFrame]

Process the testing data. :param inputs: Container DataFrame.

Returns

Container DataFrame after Truncated SVD.

Parameters
  • inputs – The inputs of shape [num_inputs, …].

  • timeout – A maximum time this primitive should take to produce outputs during this method call, in seconds.

  • iterations – How many of internal iterations should the primitive do.

Returns

Return type

The outputs of shape [num_inputs, …] wrapped inside CallResult.

set_params(*, params: tods.feature_analysis.SKTruncatedSVD.Params) → None

Set parameters for SKTruncatedSVD. :param params: class Params

Returns

None

Parameters

params – An instance of parameters.

set_training_data(*, inputs: d3m.container.pandas.DataFrame) → None

Set training data for SKTruncatedSVD. :param inputs: Container DataFrame

Returns

None

Parameters

inputs – The inputs.

tods.feature_analysis.SpectralResidualTransform module

tods.feature_analysis.StatisticalAbsEnergy module

tods.feature_analysis.StatisticalAbsSum module

tods.feature_analysis.StatisticalGmean module

tods.feature_analysis.StatisticalHmean module

tods.feature_analysis.StatisticalKurtosis module

tods.feature_analysis.StatisticalMaximum module

tods.feature_analysis.StatisticalMean module

tods.feature_analysis.StatisticalMeanAbs module

tods.feature_analysis.StatisticalMeanAbsTemporalDerivative module

tods.feature_analysis.StatisticalMeanTemporalDerivative module

tods.feature_analysis.StatisticalMedian module

tods.feature_analysis.StatisticalMedianAbsoluteDeviation module

tods.feature_analysis.StatisticalMinimum module

tods.feature_analysis.StatisticalSkew module

tods.feature_analysis.StatisticalStd module

tods.feature_analysis.StatisticalVar module

tods.feature_analysis.StatisticalVariation module

tods.feature_analysis.StatisticalVecSum module

tods.feature_analysis.StatisticalWillisonAmplitude module

tods.feature_analysis.StatisticalZeroCrossing module

tods.feature_analysis.TRMF module

class tods.feature_analysis.TRMF.TRMF(*args, **kwds)

Bases: d3m.primitive_interfaces.transformer.TransformerPrimitiveBase

Temporal Regularized Matrix Factorization.

F

Latent embedding of timeseries.

Type

ndarray, shape (n_timeseries, K)

X

Latent embedding of timepoints.

Type

ndarray, shape (K, n_timepoints)

W

Matrix of autoregressive coefficients.

Type

ndarray, shape (K, n_lags)

Reference
----------
"https
Type

//github.com/SemenovAlex/trmf”

Yu, H. F., Rao, N., & Dhillon, I. S. (2016). Temporal regularized matrix factorization for high-dimensional time series prediction.
In Advances in neural information processing systems (pp. 847-855).
Which can be found there
Type

http://www.cs.utexas.edu/~rofuyu/papers/tr-mf-nips.pdf

Parameters
  • lags (array-like, shape (n_lags,)) – Set of lag indices to use in model.

  • K (int) – Length of latent embedding dimension

  • lambda_f (float) – Regularization parameter used for matrix F.

  • lambda_x (float) – Regularization parameter used for matrix X.

  • lambda_w (float) – Regularization parameter used for matrix W.

  • alpha (float) – Regularization parameter used for make the sum of lag coefficient close to 1. That helps to avoid big deviations when forecasting.

  • eta (float) – Regularization parameter used for X when undercovering autoregressive dependencies.

  • max_iter (int) – Number of iterations of updating matrices F, X and W.

  • F_step (float) – Step of gradient descent when updating matrix F.

  • X_step (float) – Step of gradient descent when updating matrix X.

  • W_step (float) – Step of gradient descent when updating matrix W.

produce(*, inputs: d3m.container.pandas.DataFrame, timeout: float = None, iterations: int = None) → d3m.primitive_interfaces.base.CallResult[d3m.container.pandas.DataFrame]

Process the testing data. :param inputs: Container DataFrame.

Returns

Container DataFrame after Truncated SVD.

Parameters
  • inputs – The inputs of shape [num_inputs, …].

  • timeout – A maximum time this primitive should take to produce outputs during this method call, in seconds.

  • iterations – How many of internal iterations should the primitive do.

Returns

Return type

The outputs of shape [num_inputs, …] wrapped inside CallResult.

tods.feature_analysis.WaveletTransform module

class tods.feature_analysis.WaveletTransform.WaveletTransformer(*args, **kwds)

Bases: d3m.primitive_interfaces.transformer.TransformerPrimitiveBase

A primitive of Multilevel 1D Discrete Wavelet Transform of data. See PyWavelet documentation for details.

metadata

Primitive’s metadata. Available as a class attribute.

logger

Primitive’s logger. Available as a class attribute.

hyperparams

Hyperparams passed to the constructor.

random_seed

Random seed passed to the constructor.

docker_containers

A dict mapping Docker image keys from primitive’s metadata to (named) tuples containing container’s address under which the container is accessible by the primitive, and a dict mapping exposed ports to ports on that address.

volumes

A dict mapping volume keys from primitive’s metadata to file and directory paths where downloaded and extracted files are available to the primitive.

temporary_directory

An absolute path to a temporary directory a primitive can use to store any files for the duration of the current pipeline run phase. Directory is automatically cleaned up after the current pipeline run phase finishes.

Parameters
  • wavelet (str) – Wavelet to use

  • mode (str) – Signal extension mode, see https://pywavelets.readthedocs.io/en/latest/ref/signal-extension-modes.html#ref-modes for details.

  • axis (int) – Axis over which to compute the DWT. If not given, transforming along columns.

  • window_size (int) – The moving window size.

  • level (int) – Decomposition level (must be > 0). If level is 0 (default) then it will be calculated using the maximum level.

  • Attributes

  • ----------

  • None

produce(*, inputs: d3m.container.pandas.DataFrame, timeout: float = None, iterations: int = None) → d3m.primitive_interfaces.base.CallResult[d3m.container.pandas.DataFrame]

Process the testing data. :param inputs: Container DataFrame. Time series data up to Wavelet transform.

Returns

Container DataFrame after Wavelet Transformation. Ordered frame of coefficients arrays where n denotes the level of decomposition. The first element (cA_n) of the result is approximation coefficients array and the following elements (cD_n - cD_1) are details coefficients arrays.

Return type

[cA_n, cD_n, cD_n-1, …, cD2, cD1]

Parameters
  • inputs – The inputs of shape [num_inputs, …].

  • timeout – A maximum time this primitive should take to produce outputs during this method call, in seconds.

  • iterations – How many of internal iterations should the primitive do.

Returns

Return type

The outputs of shape [num_inputs, …] wrapped inside CallResult.

Module contents