-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to mask or ignore target features during model training #2381
Comments
Hi @yunakkano, If you have a component that you're not interested in forecasting, you have two options:
|
Can you elaborate on what you mean by "the target values are not available at prediction time"? Just for clarification:
|
Hi @madtoinou and @dennisbader , Thank you both for your helpful responses. I appreciate your insights and suggestions. To clarify my scenario, I have a timeseries dataset with feature columns x1, x2, x3, and y. The variable y is the target I want to predict, but it is only available after x1, x2, and x3 are observed. This means that y cannot be used during the training of the prediction model. Assuming a time horizon t_0, t_1, ..., t_now, t_now+1, and so on, we are currently at t_now. I want to train the model with the features x1, x2, and x3 from the time section t_0 to t_now in order to predict y values from t_now+1 onwards. To address your question, @dennisbader , regarding what I mean by "the target values are not available at prediction time," here is some pseudo code to illustrate my situation. I aim to build a (If my understanding is wrong, correct me please.) Here is the pseudo code for reference:
Given this context, could you provide more specific advice on how to handle this scenario within the Darts framework? Is there a way to mask or ignore the y values from the past time steps during model training while still training the model to predict y values from t_now+1 onwards? Thank you again for your assistance. Best regards, |
Hi @yunakkano let me see if I understand your problem correctly. If you were to predict in this moment, your scenario would look something like below?
There are two ways to this.
|
Hi @dennisbader, Thank you for your detailed response and for defining my problem more clearly, as well as explaining the use of the To further clarify, my main issue is that the target variable y is unavailable even within the 6 past time steps. The timing when y becomes available is significantly later than when x1 at tnow is observed. For example, if the intervals are in hours, the value of y at tnow might only be available several weeks later. Here is the table to illustrate my scenario:
In this context, defining an exact number for |
Hi @yunakkano, in that case, the only option is to use our regression models without using any information of the target series
|
Hi @dennisbader, Thank you for the recommendation to use the regression models without any information from the target series y as input. I have a somewhat naive question: would it be possible to customize the original TSMixer model to handle my scenario by, for example, fixing y to a specific value during training to prevent the model from learning from the target? Specifically, do you think a customization where we replace all information of the target column with zero in the forward() method of the _TSMixerModule class would be effective? Thank you again for your assistance. |
Hi @yunakkano, yes you can overwrite the forward pass to ignore the past target values in the input chunk.
Now we can use this new model as the original
|
Wow, @dennisbader ! I never imagined you could come up with such an amazing idea. Thank you so much for this detailed explanation and the code example. I'm really excited to try this out. Just to confirm, based on your implementation here: x_past = x_past[:, :, self.input_target_dim:] Thanks again for your incredible support. |
Hi @yunakkano, no worries. Yes, they must be located at the beginning. This is handled automatically by our datasets, so you shouldn't have to worry about it. |
I wish this issue was created 3 days ago when I wanted to do exactly the same.
and then these can be used with fit/predict_from_dataset accordingly |
Hi @tRosenflanz, this is certainly another way to do it, just that in this case your model complexity is larger for handling the redundant information. |
This discussion is really helpful. hope all models will have the option to ignore past target values |
I am having a difficulty to train TSMixer model in my current project where target values wouldn't be available at the time of prediction.
Is there any option to mask or ignore past target values during model traing?
The text was updated successfully, but these errors were encountered: