Tsflex

Latest version: v0.4.0

Safety actively analyzes 626118 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.4.0

New features

Now you can utilize the [FeatureCollection.calculate](https://predict-idlab.github.io/tsflex/features/#tsflex.features.FeatureCollection.calculate) method to compute feature based on group ids.

Specifically, 2 arguments wre atted to this FeatureCollection.calculate method:

- `group_by_all`: creates groups that contains all rows corresponding to the group value
* Note that this is +/- identical as passing df.groupby(group_by_all) as data to the .calculate method -> (which is now also a valid input for the data argument)
- `group_by_consecutive`: creates groups that contain consecutive rows for the group value

*Note*: Both grouped feature extraction approaches ignore `NaNs` in the group_by column.

Curious? :Look at our verbose [example notebook](https://github.com/predict-idlab/tsflex/blob/main/examples/verbose_example.ipynb) - `grouping feature extraction`

What's Changed
* ๐ŸŽ improving loggers as described in 66 by jonasvdd in https://github.com/predict-idlab/tsflex/pull/73
* :broom: some necessary maintenance by jvdd in https://github.com/predict-idlab/tsflex/pull/80
* :wood: log % duration + output_names for FeatureCollection by jvdd in https://github.com/predict-idlab/tsflex/pull/83
* :sparkles: validate integration with antropy by jvdd in https://github.com/predict-idlab/tsflex/pull/88
* :tada: validate nolds integration by jvdd in https://github.com/predict-idlab/tsflex/pull/94
* ใ€ฐ๏ธ remove isort and use ruff instead by jvdd in https://github.com/predict-idlab/tsflex/pull/99
* :arrow_up: support Python 3.11 by jvdd in https://github.com/predict-idlab/tsflex/pull/87
* :tada: validate pyentrp integration by jvdd in https://github.com/predict-idlab/tsflex/pull/95
* :bug: support functools.partial by jvdd in https://github.com/predict-idlab/tsflex/pull/104
* ๐Ÿ‘ท build: create codeql.yml by NielsPraet in https://github.com/predict-idlab/tsflex/pull/106
* Build/codspeed setup by NielsPraet in https://github.com/predict-idlab/tsflex/pull/107
* :arrow_up: update antropy dependency + disable py 3.7 tests by jvdd in https://github.com/predict-idlab/tsflex/pull/108
* :arrow_up: update dependencies by jvdd in https://github.com/predict-idlab/tsflex/pull/111
* โœจ feat: Feature extraction with an identifier by NielsPraet in https://github.com/predict-idlab/tsflex/pull/109
* :arrow_up: soften pandas lock by jvdd in https://github.com/predict-idlab/tsflex/pull/115
* :rocket: Python 3.12 support by jvdd in https://github.com/predict-idlab/tsflex/pull/116

New Contributors
* NielsPraet made their first contribution in https://github.com/predict-idlab/tsflex/pull/106

**Full Changelog**: https://github.com/predict-idlab/tsflex/compare/v0.3.0...v0.4.0

0.3.0

What's Changed
* :goal_net: update make_robust by jvdd in https://github.com/predict-idlab/tsflex/pull/45
* :art: Update examples by jvdd in https://github.com/predict-idlab/tsflex/pull/46
* ๐Ÿ’จ series_pipeline insert & append is more compose-like by jonasvdd in https://github.com/predict-idlab/tsflex/pull/47
* :pushpin: Update dependencies by jvdd in https://github.com/predict-idlab/tsflex/pull/48
* :see_no_evil: minor bug fix in make_robust by jvdd in https://github.com/predict-idlab/tsflex/pull/52
* :ambulance: Fix windows bug by jvdd in https://github.com/predict-idlab/tsflex/pull/53
* :ambulance: update critical depencies by jvdd in https://github.com/predict-idlab/tsflex/pull/55
* :sparkles: vectorized feature function support by jvdd in https://github.com/predict-idlab/tsflex/pull/58
* [MRG] Remove deprecated closed argument in pd.daterange by jeroenboeye in https://github.com/predict-idlab/tsflex/pull/64
* :bug: fix bug with bound_method + :sparkles: new integrations by jvdd in https://github.com/predict-idlab/tsflex/pull/62
* :recycle: improve output indexing by jvdd in https://github.com/predict-idlab/tsflex/pull/68
* :crayon: improve the `make_robust docs` by jonasvdd in https://github.com/predict-idlab/tsflex/pull/72
* :sparkles: decouple stride + support setpoints by jvdd in https://github.com/predict-idlab/tsflex/pull/74
* :recycle: refactor indexing + :scissors: decouple stride & window + :sparkles: support segment idxs by jvdd in https://github.com/predict-idlab/tsflex/pull/71

Major changes

Updates on the output indexing

:scissors: Decoupling of stride & window from FeatureDescriptors
* Both argments are now optional.
* The stride can now also be a list of stride values

:sparkles: Support segment indexes
* Users can now add their start & end segment indexes to the `FeatureCollection.calculate` method - allowing even more flexible feature extraction :wink:


**Full Changelog**: https://github.com/predict-idlab/tsflex/compare/v0.2.3...v0.3

---

<sub>**DISCLAIMER:** this release was already published some months ago (11 Oct, 2022) on [pypi](https://pypi.org/project/tsflex/0.3.0/).
Our apologies for the late tag + release on GitHub. </sub>

0.2.3

โ— See also: [tsflex v0.2.2](https://github.com/predict-idlab/tsflex/releases/tag/v0.2.2) which is even more ๐Ÿ”ฅ than this one

New features
๐Ÿ’š Next to the [tsfresh integrations](https://predict-idlab.github.io/tsflex/features/integrations.html#tsflex.features.integrations.tsfresh_settings_wrapper), tsflex's feature extraction now fully integrates with [seglearn](https://predict-idlab.github.io/tsflex/features/integrations.html#tsflex.features.integrations.seglearn_wrapper) and [tsfel](https://predict-idlab.github.io/tsflex/features/integrations.html#tsflex.features.integrations.tsfel_feature_dict_wrapper) โฌ‡๏ธ

python
from seglearn.feature_functions import base_features
from tsfel.feature_extraction import get_features_by_domain

from tsflex.features import FeatureCollection, MultipleFeatureDescriptors
from tsflex.features.integrations import seglearn_feature_dict_wrapper, tsfel_feature_dict_wrapper
from tsflex.utils.data import load_empatica_data

Load sequence-indexed data (in this case a time-index)
df_tmp, df_acc = load_empatica_data(['tmp', 'acc'])

Construct your feature extraction configuration & extract features
fc = FeatureCollection(
MultipleFeatureDescriptors(
functions=[
*seglearn_feature_dict_wrapper(base_features()),
*tsfel_feature_dict_wrapper(get_features_by_domain('statistical')),
],
series_names=["TMP", "ACC_x", "ACC_y"],
windows=["5min", "15min"],
strides="5min"
)
)

fc.calculate(data=[df_tmp, df_acc], return_df=True)


Changes
๐ŸŽ‰ The `FeatureCollection.calculcate` it's feauture-DataFrame output now has a determenistic column order see - 40

0.2.2

New features
* ๐Ÿ”ฅ Now also supports feature-extraction on [numeric-index data](https://predict-idlab.github.io/tsflex/features/segmenter/strided_rolling.html#tsflex.features.segmenter.strided_rolling.SequenceStridedRolling) (and thus not only time-based data)
* ๐Ÿ’š Seamless integration with `tsfresh`, check out the example below:
python
from tsfresh.feature_extraction import MinimalFCParameters; import scipy.stats as ss

from tsflex.features import FeatureCollection, MultipleFeatureDescriptors
from tsflex.features.integrations import tsfresh_settings_wrapper
from tsflex.utils.data import load_empatica_data

Load sequence-indexed data (in this case a time-index)
df_tmp, df_acc = load_empatica_data(['tmp', 'acc'])

Construct your feature extraction configuration & extract features
fc = FeatureCollection(
MultipleFeatureDescriptors(
functions=tsfresh_settings_wrapper(MinimalFCParameters()) + [ss.skew],
series_names=["TMP", "ACC_x", "ACC_y"],
windows=["5min", "15min"],
strides="5min"
)
)

fc.calculate(data=[df_tmp, df_acc], return_df=True)

* โšก Optimized strided-rolling feature-extraction, see the newly generated benchmark โฌ‡๏ธ

![image](https://user-images.githubusercontent.com/38005924/141680605-9b9874b9-7afb-4d49-a63b-a18be3bb967a.png)

* Added [FeatureCollection.**reduce()**](https://predict-idlab.github.io/tsflex/features/index.html#tsflex.features.FeatureCollection.reduce) which comes in really handy when feature selection is performed in your machine-learning pipeline
* ๐Ÿป [chunk\_data()](https://predict-idlab.github.io/tsflex/chunking/index.html#tsflex.chunking.chunk_data) now also supports DataFrame-dicts as input, which can be more convenient when having DataFrames with a lot of columns for which you want to specify the sample-frequencies.
* ๐ŸŒป [SeriesPipeline](https://github.com/predict-idlab/tsflex/blob/2984bda4ccb17a5c22da1f117b2d0e1749546c8f/tsflex/processing/series_pipeline.py#L22) is now more compose-like as it now accepts SeriesPipeline instances

Changes

* ๐Ÿงต Changed [pathos](https://github.com/uqfoundation/pathos) โžก๏ธ [multiprocess](https://github.com/uqfoundation/multiprocess) as multiprocessing back-end
* ๐Ÿ”ง Moved the `bound_method` argument to [FeatureCollection.calculate()](https://predict-idlab.github.io/tsflex/features/index.html#tsflex.features.FeatureCollection.calculate)
* ๐Ÿ“ Rewrote strided-rolling back-end in a more OO manner (introduced the [segmenter](https://predict-idlab.github.io/tsflex/features/segmenter/index.html) module), which complies with our roadmap of providing more segmenting functionality

Links

Releases

Has known vulnerabilities

ยฉ 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.