tods.feature_analysis module

tods.feature_analysis.AutoCorrelation

class tods.feature_analysis.AutoCorrelation.AutoCorrelationPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

A primitive that performs autocorrelation on a DataFrame acf() function documentation: https://www.statsmodels.org/dev/generated/statsmodels.tsa.stattools.acf.html

Parameters
  • -------

  • x – array_like The time series data.

  • unbiased – bool, default False If True, then denominators for autocovariance are n-k, otherwise n.

  • nlags – int, default 40 Number of lags to return autocorrelation for.

  • qstat – bool, default False If True, returns the Ljung-Box q statistic for each autocorrelation coefficient. See q_stat for more information.

  • fft – bool, default None If True, computes the ACF via FFT.

  • alpha – scalar, default None If a number is given, the confidence intervals for the given level are returned. For instance if alpha=.05, 95 % confidence intervals are returned where the standard deviation is computed according to Bartlett”s formula.

  • missing – str, default “none” A string in [“none”, “raise”, “conservative”, “drop”] specifying how the NaNs are to be treated. “none” performs no checks. “raise” raises an exception if NaN values are found. “drop” removes the missing observations and then estimates the autocovariances treating the non-missing as contiguous. “conservative” computes the autocovariance using nan-ops so that nans are removed when computing the mean and cross-products that are used to estimate the autocovariance. When using “conservative”, n is set to the number of non-missing observations.

  • -------

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.

tods.feature_analysis.BKFilter

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

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

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’

tods.feature_analysis.DiscreteCosineTransform

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

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

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’

tods.feature_analysis.FastFourierTransform

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

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

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’

tods.feature_analysis.HPFilter

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

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

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’

tods.feature_analysis.NonNegativeMatrixFactorization

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

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

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’

tods.feature_analysis.SKTruncatedSVD

class tods.feature_analysis.SKTruncatedSVD.SKTruncatedSVDPrimitive(*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

class tods.feature_analysis.SpectralResidualTransform.SpectralResidualTransformPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find Spectral Residual Transform of time series

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.

tods.feature_analysis.StatisticalAbsEnergy

class tods.feature_analysis.StatisticalAbsEnergy.StatisticalAbsEnergyPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find abs_energy of time series

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.

tods.feature_analysis.StatisticalAbsSum

class tods.feature_analysis.StatisticalAbsSum.StatisticalAbsSumPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find abs_sum of time series

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.

tods.feature_analysis.StatisticalGmean

class tods.feature_analysis.StatisticalGmean.StatisticalGmeanPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find gmean of time series . Will only take positive values as inputs .

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.

tods.feature_analysis.StatisticalHmean

class tods.feature_analysis.StatisticalHmean.StatisticalHmeanPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find Harmonic mean of time series

Harmonic mean only defined if all elements greater than or equal to zero

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.

tods.feature_analysis.StatisticalKurtosis

class tods.feature_analysis.StatisticalKurtosis.StatisticalKurtosisPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find kurtosis of time series

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.

tods.feature_analysis.StatisticalMaximum

class tods.feature_analysis.StatisticalMaximum.StatisticalMaximumPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find maximum of time series

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.

tods.feature_analysis.StatisticalMean

class tods.feature_analysis.StatisticalMean.StatisticalMeanPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find mean of time series

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.

tods.feature_analysis.StatisticalMeanAbs

class tods.feature_analysis.StatisticalMeanAbs.StatisticalMeanAbsPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find mean_abs of time series

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.

tods.feature_analysis.StatisticalMeanAbsTemporalDerivative

class tods.feature_analysis.StatisticalMeanAbsTemporalDerivative.StatisticalMeanAbsTemporalDerivativePrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find mean_abs_temporal_derivative of time series

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.

tods.feature_analysis.StatisticalMeanTemporalDerivative

class tods.feature_analysis.StatisticalMeanTemporalDerivative.StatisticalMeanTemporalDerivativePrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find mean_temporal_derivative of time series

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.

tods.feature_analysis.StatisticalMedian

class tods.feature_analysis.StatisticalMedian.StatisticalMedianPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find median of time series

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.

tods.feature_analysis.StatisticalMedianAbsoluteDeviation

class tods.feature_analysis.StatisticalMedianAbsoluteDeviation.StatisticalMedianAbsoluteDeviationPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find median_absolute_deviation of time series

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.

tods.feature_analysis.StatisticalMinimum

class tods.feature_analysis.StatisticalMinimum.StatisticalMinimumPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find minimum of time series

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.

tods.feature_analysis.StatisticalSkew

class tods.feature_analysis.StatisticalSkew.StatisticalSkewPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find skew of time series

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.

tods.feature_analysis.StatisticalStd

class tods.feature_analysis.StatisticalStd.StatisticalStdPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find std of time series

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.

tods.feature_analysis.StatisticalVar

class tods.feature_analysis.StatisticalVar.StatisticalVarPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find var of time series

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.

tods.feature_analysis.StatisticalVariation

class tods.feature_analysis.StatisticalVariation.StatisticalVariationPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find variation of time series

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.

tods.feature_analysis.StatisticalVecSum

class tods.feature_analysis.StatisticalVecSum.StatisticalVecSumPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find vec_sum of time series

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.

tods.feature_analysis.StatisticalWillisonAmplitude

class tods.feature_analysis.StatisticalWillisonAmplitude.StatisticalWillisonAmplitudePrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find willison amplitude of time series

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.

tods.feature_analysis.StatisticalZeroCrossing

class tods.feature_analysis.StatisticalZeroCrossing.StatisticalZeroCrossingPrimitive(*args, **kwds)

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

Primitive to find zero_crossing of time series. A column indicating zero crossing on ith row . 1 indicates crossing 0 is for normal

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.

tods.feature_analysis.TRMF

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

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

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.

tods.feature_analysis.WaveletTransform

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

Bases: tods.common.TODSBasePrimitives.TODSTransformerPrimitiveBase

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