cydal / tsExtract

Time series feature extraction for Supervised Learning Modeling
GNU General Public License v2.0
46 stars 8 forks source link

The statistic function currently in win_stats are basic and more could be added. #5

Closed cydal closed 4 years ago

cydal commented 4 years ago

@vks: You could avoid this by making the function accept a function as an argument, instead of a string. Then the users can specify any statistic and you don't have to explicitly support them.

cydal commented 4 years ago

@vks: You could avoid this by making the function accept a function as an argument, instead of a string. Then the users can specify any statistic and you don't have to explicitly support them.

This is a great idea @vks.

Two things to note, another thing is that not all the functions even exist in other libraries. For the former point -

Not all the functions come from the same library - The basic statistic functions come from Numpy and others like "kurtosis" e.t.c come from Scipy.

Some functions don't come in packages (These would be in the majority) - e.g Absolute energy, this is calculated as the sum over the squared values and would need to be implemented.

vks commented 4 years ago

I think numpy.linalg.norm calculates the sum of squares. The name is very different though.

cydal commented 4 years ago

I admit I didn't check that. I only used that as an example. See tsfresh's page for some of the functions they implemented. https://tsfresh.readthedocs.io/en/latest/text/list_of_features.html

I admit though that the string input could be problematic. One thing we can consider is include wrappers for those functions, and allow for them to be imported and used. For example -

from tsFresh import mean, median, approximate_entropy

And pass this in to build_features.

cydal commented 4 years ago

Added statistics, temporal & spectral features. Only one spectral feature added till I take some time to read up on them. Reference for the different domain features -

https://www.researchgate.net/figure/Spectral-Statistical-and-Temporal-Domain-Features-used-in-the-present-work-1-Features_fig6_301683665

cydal commented 4 years ago

Completed functionality for passing in functions. Also accepts functions from other libraries as long as function follows the same format of function(data, axis=1).