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

Enable feature reduction using data transformers #2342

Open
NBeugen opened this issue Apr 19, 2024 · 1 comment
Open

Enable feature reduction using data transformers #2342

NBeugen opened this issue Apr 19, 2024 · 1 comment
Labels
question Further information is requested

Comments

@NBeugen
Copy link

NBeugen commented Apr 19, 2024

When defining a Pipeline using sklearn scalers such as:
pipeline = Pipeline([Scaler(scaler = StandardScaler()), Scaler(scaler = PCA(n_components = 0.1, svd_solver = 'full'))])
And transforming a Sequence of Timeseries using:
test = pipeline.fit_transform(covars)

The resulting error is given as output:
The new values must have the same shape (time, components) as the present series.

I figure that the Transformer class is not able to perform feature reduction, or have less components as the new values than the present series.

Describe proposed solution
It would be great to have the option of dimensionality reduction for transforming Timeseries or a Sequence of Timeseries.

Describe potential alternatives
Not aware of any alternatives in the Darts package. My solution currently is processing everything using dataframes in sklearn.

@NBeugen NBeugen added the triage Issue waiting for triaging label Apr 19, 2024
@madtoinou
Copy link
Collaborator

Hi @NBeugen,

The Scaler derived objects are intended to modify the range of the values only, not the shape of the TimeSeries.

If you want to modify the number of components, by inserting new one or removing some, you need to define a new class FeaturesProjection, inheriting from the BaseDataTransformer (doc) that implement the feature selection/transformation logic in the ts_transform method .

@madtoinou madtoinou added question Further information is requested and removed triage Issue waiting for triaging labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants