Closed orenpapers closed 3 years ago
There are multiple examples with context data. For instance.
I suggest you look at some of the other examples and the API documentation, and play around with your toy data to get a sense of how its working. For instance if you segment a time series with 10 samples, using a width of 3 and no overlap, you will get 3 separate segments and 3 target values (assuming y is also a time series). Many ML algorithms require fixed length time series for classification/regression, and with this package you can use sliding window segmentation or padding/truncation to achieve that in your time series pipeline.
@dmbee Thanks, I tried to mock many types of data but I can't understand the relation between the output and the documentation. Can you please explain the outputs of the examples?
[array([[ 0, 1, 2, 3, 4, 6],
[ 4, 5, 6, 7, 8, 9],
[ 8, 9, 10, 11, 3, 4]])]
[array([ True, False, False])]
After segmentation (width=5, overlap=0.33):
X: []
y: []
Another example:
[array([[ 0, 1, 2, 3, 4, 6],
[ 4, 5, 6, 7, 8, 9],
[ 8, 9, 10, 11, 3, 4]])]
[array([ True, False, False])]
After segmentation (width=3, overlap=0.2):
X: [[[ 0 1 2 3 4 6]
[ 4 5 6 7 8 9]
[ 8 9 10 11 3 4]]]
y: [False]
Why width is 6 ant not 3? why only 1 y value?
There are multiple examples with context data. For instance.
@dmbee I saw this example but I am not sure why is this considered as contextual features and not just stacking/adding more features because: u stack the contextual features next to the data features, which means the features vector is flattened. So if u have 15 data features and 5 context features, it will be turned to 20 flat features that will be treated equally, rather than 5 features that are added as context on top of the 15 data features. (Similarly to conditional RNN : https://github.com/philipperemy/cond_rnn). Do you have a way to add the contextual features as condition/context to the data features, rather than just stack them as additional features?
The context features are broadcast to every segment in the series and separate, they are not flattened together.
@dmbee I know, I just mean that for each sample , the contextual features are flattened together with the data features. So, to my understanding from the code (correct me if I'm wrong), if I have 15 data features and 5 context features , I will have now 20 features per vector, but the model won't model them differently - meaning he will treat this as one vector of 20 features and not 15 data features + 5 context features (as done for example in Conditional). right?
I don't understand your question. I suggest you look at the documentation and the code, it's an open source project.
Hello, I can't understand the usage of the segment class, in what cases I need to use this transform and how does it help? I also couldn't find an example as how to incorporate contextual variables? When I run it on toy data - it is very unclear what happened, since X is unchanged by y was reduced to a single value: