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

Get features for each line #114

Closed
IKetchup opened this issue Apr 14, 2022 · 1 comment
Closed

Get features for each line #114

IKetchup opened this issue Apr 14, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@IKetchup
Copy link

Hello,

I would like to generate features for each observation of my time serie and not only window by window.

Does this possibility exist in tsfel and do you know how to do it ?

Thanks in advance

@dmfolgado dmfolgado self-assigned this Apr 15, 2022
@dmfolgado dmfolgado added the question Further information is requested label Apr 15, 2022
@dmfolgado
Copy link
Member

Hello, if you're interested in extracting features for each observation you must set the window_size=1. An example code would be:

import tsfel

ts = np.random.randn(100)
cfg = tsfel.get_features_by_domain("statistical")
features = tsfel.time_series_features_extractor(cfg, ts, window_size = 1, fs=100)
print(len(ts), np.shape(features))

You should have 100 lines in the feature vector (one line per observation of your time series of len=100).

Please note that for some features it is not adequate to use a feature per observation since they are expecting a window larger than 1. The values calculated values should be carefully interpreted and you are recommended to select features that make sense calculating with individual observations. You might also encounter some errors in spectral features that are expecting a larger window size.

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

3 participants