Closed cydal closed 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.
I think numpy.linalg.norm
calculates the sum of squares. The name is very different though.
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.
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 -
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).
@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.