Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement series-to-series transformers #483

Closed
mloning opened this issue Nov 13, 2020 · 4 comments · Fixed by #509
Closed

Implement series-to-series transformers #483

mloning opened this issue Nov 13, 2020 · 4 comments · Fixed by #509
Labels
feature request New feature or request good first issue Good for newcomers

Comments

@mloning
Copy link
Contributor

mloning commented Nov 13, 2020

Describe the solution you'd like
Here's a simple example of a series-to-series log transformer transformer:

All of these transforms are series-to-series transforms. For an overview of different kinds of transformations, see this document.

import numpy as np
import pandas as pd

from sktime.transformers.base import _SeriesToSeriesTransformer
from sktime.utils.validation.series import 

class LogTransformer(_SeriesToSeriesTransformer):

    _tags = {"transform-returns-same-time-index": True}

    def transform(self, Z, X=None):
        self.check_is_fitted()
        Z = check_series(Z)
        return np.log(Z)

    def inverse_transform(self, Z, X=None):
        self.check_is_fitted()
        Z = check_series(Z)
        return np.exp(Z)

List of transformations we'd like to include in sktime

Transform Package/Function
FFT/DFT https://docs.scipy.org/doc/numpy-1.15.0/reference/routines.fft.html
Autocorrelation function (ACF) https://www.statsmodels.org/0.9.0/generated/statsmodels.tsa.stattools.acf.html
Partial autocorrelation function (autoregressive coefficients) (PACF) https://www.statsmodels.org/0.9.0/generated/statsmodels.tsa.stattools.pacf.html
Auto Regressive Moving Average (ARMA) https://www.statsmodels.org/0.9.0/generated/statsmodels.tsa.arima_model.ARMA.html
Power Spectrum https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.signal.periodogram.html
Cepstrum https://github.com/python-acoustics/python-acoustics/blob/master/acoustics/cepstrum.py
Cosine https://docs.scipy.org/doc/numpy/reference/generated/numpy.cos.html

Related issues
see #6, #224 and #297

@mloning mloning added feature request New feature or request good first issue Good for newcomers labels Nov 13, 2020
@mloning
Copy link
Contributor Author

mloning commented Nov 16, 2020

Hi @Afzal-Ind, could you tell me which part isn't clear? You can message me here or on Gitter.

@afzal442
Copy link
Contributor

Could you tell me which part isn't clear?

Thanks. I am not clear about series-to-series log transformer is how it works basically.

@mloning
Copy link
Contributor Author

mloning commented Nov 17, 2020

@Afzal-Ind There is an example in the linked document. Does that make it clearer?

@afzal442
Copy link
Contributor

Does that make it clearer?

Thanks again. It may take some time but I will keep up with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants