Skip to content
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

question: TFT for time series classification #164

Closed
DominikKrock opened this issue Nov 19, 2020 · 2 comments
Closed

question: TFT for time series classification #164

DominikKrock opened this issue Nov 19, 2020 · 2 comments
Labels
question Further information is requested

Comments

@DominikKrock
Copy link

DominikKrock commented Nov 19, 2020

Hi,
I would like to use the temporal fusion transformer(TFT) for time-series-classification. For our illustrative example we have 2 target classes (True, False) for the cancellation of a membership.

Illustrative example:
Suppose you have an e-commerce shop, and you want to find out whether a customer will cancel his premium membership (like Amazon-prime) based on his shopping behavior.

Parameters for TimeSeriesDataSet:
target = [‘cancellation’]
group_ids= [‘customerID’]
static_categoricals = [‘zip’, ‘gender’]
time_varying_known_reals = [‘time_idx’]
time_varying_unknown_categoricals = [‘shopping_event’]
time_varying_unknown_reals = [‘age_at_shopping_event’]
max_prediction_length=1

Is it convenient to use the TFT for this kind of task?
How does the shape of the target vector look like, e.g.

  • Method 1
    - always True for customers who cancel the membership?
    - always False for customers who don’t cancel the membership?
  • Method 2
    - False until the customer cancels the membership. Then always True?

I have already implemented a BinaryCrossEntropyLoss metric analogous to the CrossEntropyLoss.
If you like, I can make a merge request for the BinaryCrossEntropyLoss.

Thanks for your ideas

@jdb78
Copy link
Owner

jdb78 commented Nov 21, 2020

PRs are always very welcome!

I would generally go with method 2 because you do not want to use unknown information. Further, I would use max_prediction_length=1. You can use a label as well if someone will cancel their subscription in the next 3 months. Ensure that you are not using the cancellation target as feature. You might want to add a relative time index as well (see the docs how to add this automatically with the timeseriesdataset.

Effectively, you will this way use mostly the encoder of the TFT.

@jdb78 jdb78 added enhancement New feature or request question Further information is requested labels Nov 21, 2020
@jdb78 jdb78 removed the enhancement New feature or request label Dec 27, 2020
@jdb78 jdb78 closed this as completed Jan 18, 2021
@jsolson4
Copy link

I have already implemented a BinaryCrossEntropyLoss metric analogous to the CrossEntropyLoss.
If you like, I can make a merge request for the BinaryCrossEntropyLoss.

Can you please share your implementation of BinaryCrossEntropyLoss?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants