Skip to content

Index of changes in PAA and SAX #441

Description

@yasirroni

Is your feature request related to a problem? Please describe.
I'm running the tutorial of PAA and SAX in the doc

import numpy
import matplotlib.pyplot as plt

from tslearn.generators import random_walks
from tslearn.preprocessing import TimeSeriesScalerMeanVariance
from tslearn.piecewise import PiecewiseAggregateApproximation
from tslearn.piecewise import SymbolicAggregateApproximation, \
    OneD_SymbolicAggregateApproximation

numpy.random.seed(0)
# Generate a random walk time series
n_ts, sz, d = 1, 100, 1
dataset = random_walks(n_ts=n_ts, sz=sz, d=d)
scaler = TimeSeriesScalerMeanVariance(mu=0., std=1.)  # Rescale time series
dataset = scaler.fit_transform(dataset)

n_paa_segments = 10
paa = PiecewiseAggregateApproximation(n_segments=n_paa_segments)
paa_data = paa.fit_transform(dataset)
paa_dataset_inv = paa.inverse_transform(paa_data)

After reading the docs, it seems that there is no function to find the index when the paa_data changes occured.

Describe the solution you'd like
paa.get_index(paa_data) should return the index where the paa_data changes occured. That will be nice.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions