Skip to content

Commit 4e66386

Browse files
authored
Merge branch 'master' into docs-rework
2 parents 62a7d05 + 78fa87d commit 4e66386

14 files changed

+109
-689
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Oh no, you encountered a problem while using *tsfesh*.
2+
3+
We, the maintainers, are happy to help you. When opening an issue, please provide the following information to us:
4+
5+
1. Your operating system
6+
2. The version of *tsfresh* that you are using
7+
3. The data on which the problem occurred (please do not upload 1000s of time series but try to boil the problem down to a small group or even a singular one)
8+
4. A minimal code snippet which reproduces the problem/bug
9+
10+
For questions, you can also use our [gitter chatroom](https://gitter.im/tsfresh/)

CHANGES.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,23 @@ Changelog
44

55
tsfresh uses `Semantic Versioning <http://semver.org/>`_
66

7+
Version 0.7.0
8+
=============
9+
10+
- new rolling utility to use tsfresh for time series forecasting tasks
11+
- bugfixes
12+
- index_mass_quantile was using global index of time series container
13+
- an index with same name as id_column was breaking parallelization
14+
- friedrich_coefficients and max_langevin_fixed_point were occasionally stalling
15+
716
Version 0.6.0
817
=============
918

1019
- progress bar for feature selection
1120
- new feature: estimation of largest fixed point of deterministic dynamics
1221
- new notebook: demonstration how to use tsfresh in a pipeline with train and test datasets
1322
- remove no logging handler warning
14-
- fix bug in the RelevantFeatureAugmenter regarding the evaluate_only_added_features parameterqq
23+
- fixed bug in the RelevantFeatureAugmenter regarding the evaluate_only_added_features parameters
1524

1625
Version 0.5.0
1726
=============

docs/text/faq.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ FAQ
22
===
33

44

5-
1. *Does tsfresh support different time series lengths?*
5+
1. **Does tsfresh support different time series lengths?**
66
Yes, it supports different time series lengths. However, some feature calculators can demand a minimal length
77
of the time series. If a shorter time series is passed to the calculator, a NaN is returned for those
88
features.
99

1010

1111

12-
2. *Is it possible to extract features from rolling/shifted time series?*
13-
Yes, there is the option `rolling` for the :func:`tsfresh.feature_extraction.extract_features` function.
14-
Set it to a non-zero value to enable rolling. In the moment, this just rolls the input data into
15-
as many time series as there are time steps - so there is no internal optimization for rolling calculations.
16-
Please see :ref:`rolling-label` for more information.
12+
2. **Is it possible to extract features from rolling/shifted time series?**
13+
Yes, the :func:`tsfresh.dataframe_functions.roll_time_series` function allows to conviniently create a rolled
14+
time series datframe from your data. You just have to transform your data into one of the supported tsfresh
15+
:ref:`data-formats-label`.
16+
Then, the :func:`tsfresh.dataframe_functions.roll_time_series` give you a DataFrame with the rolled time series,
17+
that you can pass to tsfresh.
18+
On the following page you can find a detailed description: :ref:`rolling-label`.

docs/text/rolling.rst

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,32 @@
33
How to handle rolling time series
44
=================================
55

6-
In many application with time series on real-world problems, the "time" column
7-
(we will call it time in the following, although it can be anything)
8-
gives a certain sequential order to the data. We can exploit this sequence to generate
9-
more input data out of single time series, by *rolling* over the data.
10-
11-
Imagine the following situation: you have the data of EEG measurements, that
12-
you want to use to classify patients into healthy and not healthy (we oversimplify the problem here).
13-
You have e.g. 100 time steps of data, so you can extract features that may forecast the healthiness
14-
of the patients. But what would happen if you had only the recorded measurement for 50 time steps?
15-
The patients would be as healthy as with 100 time steps. So you can easily increase the amount of
16-
training data by reusing time series cut into smaller pieces.
17-
18-
Another example is streaming data, e.g. in Industry 4.0 applications. Here you typically get one
19-
new data row at a time and use this to predict machine failures for example. To train you model,
6+
Lets assume that we have a DataFrame of one of the tsfresh :ref:`data-formats-label`.
7+
The "sort" column of such a container gives a sequential state to the individual measurements.
8+
In the case of time series this can be the *time* dimension while in the case of spectra the order is given by the
9+
*wavelength* or *frequency* dimensions.
10+
We can exploit this sequence to generate more input data out of single time series, by *rolling* over the data.
11+
12+
Imagine the following situation:
13+
You have the data of certain sensors (e.g. EEG measurements) as the base to classify patients into a healthy and not
14+
healthy group (we oversimplify the problem here).
15+
Lets say you have sensor data of 100 time steps, so you may extract features for the forecasting of the patients
16+
healthiness by a classification algorithm.
17+
If you also have measurements of the healthiness for those 100 time steps (this is the target vector), then you could
18+
predict the healthiness of the patient in every time step, which essentially states a time series forecasting problem.
19+
So, to do that, you want to extract features in every time step of the original time series while for example looking at
20+
the last 10 steps.
21+
A rolling mechanism creates such time series for every time step by creating sub time series of the sensor data of the
22+
last 10 time steps.
23+
24+
Another example can be found in streaming data, e.g. in Industry 4.0 applications.
25+
Here you typically get one new data row at a time and use this to for example predict machine failures. To train your model,
2026
you could act as if you would stream the data, by feeding your classifier the data after one time step,
2127
the data after the first two time steps etc.
2228

2329
Both examples imply, that you extract the features not only on the full data set, but also
24-
on all temporal coherent subsets of data, which is the process of *rolling*. You can do this easily,
25-
by calling the function :func:`tsfresh.utilities.dataframe_functions.roll_time_series`.
30+
on all temporal coherent subsets of data, which is the process of *rolling*. In tsfresh, this is implemented in the
31+
function :func:`tsfresh.utilities.dataframe_functions.roll_time_series`.
2632

2733
The rolling mechanism takes a time series :math:`x` with its data rows :math:`[x_1, x_2, x_3, ..., x_n]`
2834
and creates :math:`n` new time series :math:`\hat x^k`, each of them with a different consecutive part
@@ -31,8 +37,7 @@ of :math:`x`:
3137
.. math::
3238
\hat x^k = [x_k, x_{k-1}, x_{k-2}, ..., x_1]
3339
34-
To see what this does in real-world applications, we look into the following example data frame (we show only one
35-
possible data format, but rolling works on all 3 data formats :ref:`data-formats-label`):
40+
To see what this does in real-world applications, we look into the following example flat DataFrame in tsfresh format
3641

3742
+----+------+----+----+
3843
| id | time | x | y |
@@ -50,9 +55,13 @@ possible data format, but rolling works on all 3 data formats :ref:`data-formats
5055
| 2 | t9 | 11 | 13 |
5156
+----+------+----+----+
5257

53-
where you have measured two values (x and y) for two different entities (1 and 2) in 4 or 2 time steps.
58+
where you have measured the values from two sensors x and y for two different entities (id 1 and 2) in 4 or 2 time
59+
steps (t1 to t9).
5460

55-
If you set `rolling` to 0, the feature extraction works on
61+
Now, we can use :func:`tsfresh.utilities.dataframe_functions.roll_time_series` to get consecutive sub-time series.
62+
E.g. if you set `rolling` to 0, the feature extraction works on the original time series without any rolling.
63+
64+
So it extracts 2 set of features,
5665

5766
+----+------+----+----+
5867
| id | time | x | y |
@@ -76,8 +85,6 @@ and
7685
| 2 | t9 | 11 | 13 |
7786
+----+------+----+----+
7887

79-
So it extracts 2 set of features.
80-
8188
If you set rolling to 1, the feature extraction works with all of the following time series:
8289

8390
+----+------+----+----+
@@ -164,4 +171,7 @@ If you set rolling to -1, you end up with features for the time series, rolled i
164171
| 2 | t8 | 10 | 12 |
165172
+----+------+----+----+
166173
| 2 | t9 | 11 | 13 |
167-
+----+------+----+----+
174+
+----+------+----+----+
175+
176+
We only gave an example for the flat DataFrame format, but rolling actually works on all 3 :ref:`data-formats-label`
177+
that are supported by tsfresh.

notebooks-requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
matplotlib==2.0.0
2+
seaborn==0.7.1
3+
ipython==5.3.0
4+
notebook==4.4.1

0 commit comments

Comments
 (0)