Weibull Time To Event RNN
“An algorithm & philosophy about predicting when things will happen”
Egil martinsson
ML Jeju Camp
2017-07-27
Mentor : Jeongkyu Shin
Help : Joongi Kim
& Jonghyun Park
About me
Summary of MLJejuCamp
Before
After
WTTE-RNN what?
Problem
“When will something happen?”
≈ “When will something stop happening?”
4.
3.
2.
1.
Solution: WTTE-RNN
Let your machine learning model output the parameters of a distribution and train it with a magic loss function.
Why Weibull?
Why RNN?
Weibull Time To Event RNN
“An algorithm & philosophy about predicting when things will happen”
Example : commits to Tensorflow github-
repository
Hacky solution : Binary
Less Hacky solution : WTTE-RNN
“Clever loss function”
Why Weibull Distribution?
Weibull Time To Event RNN
“An algorithm & philosophy about predicting when things will happen”
2. Predict a distribution:
3. Use a clever loss from survival analysis
4. Train RNNs
5. Get useful predictions
Vision
Example : commits to Tensorflow github-
repository
Summary of ML-jejucamp
Before
After
Some real examples
Take any dataframe with
ID, Timestamp, Features
and transform it into what you need for training.
Events (matrix)
[n_seq, n_timesteps]
Censoring indicators (matrix)
TTE (matrix)
Features (Tensor)
Events (matrix)
[n_seq, n_timesteps, n_features]
(Beta output activation function)
(Alpha output activation function)
Loss function:
Experiment:
Features:
Sex, Age, #clicks per day
*Dees, M.; van Dongen, B.F. (2016) BPI Challenge 2016. UWV. Dataset.
(Weird architecture not recommended but I wanted some smooth embeddings to show)
Predicted alpha ≈ predicted location (like in the normal distribution) “When”
Predicted beta ≈ predicted scale (like in the normal distribution) “How sure we are”
Beta ~ “How sure we are”
Alpha ~ “When”
Dots are colored
Red dots if moving to the right (i.e prediction is higher than yesterday)
Blue marks users first day
How sure
When
Temporal 2d-embeddings
Jobsearch/social service-website Clickstream data
Beta ~ “How sure we are”
Alpha ~ “When”
Dots are colored
Red dots if moving to the right (i.e prediction is higher than yesterday)
Blue marks users first day
How sure
When
Temporal 2d-embeddings
Jobsearch/social service-website Clickstream data
Beta ~ “How sure we are”
Alpha ~ “When”
Dots are colored
Red dots if moving to the right (i.e prediction is higher than yesterday)
Blue marks users first day
How sure
When
Temporal 2d-embeddings
Tensorflow github-commits
Problems
Predicted TTE stable but huge!
Another solution that shows promise:
Example: Machine failure
Machine run-to failure experiments
(Turbofan dataset)
alpha vs beta
When
When
alpha vs beta vs time
Conclusion
Code
Code
Py2 + Py3
TODO
> pip install wtte
Thank you
Weibull Time To Event RNN
“An algorithm & philosophy about predicting when things will happen”
2. Predict a distribution:
3. Use a clever loss from survival analysis
4. Train RNNs
5. Get useful predictions
Jejucamp goals:
Example : commits to Tensorflow github-
repository
Survival methods math