# Godday's Solution that didn't Appear in Public Notebooks.

This competition is full of positions, and I don't know if I can get a good result in the end. But I figured I'd forget about the game if I waited another 3 months, so I decided to share my solution anyway.
0. Preface:
Hi all people diving in this competition,
We had a very memorable racing experience together (at least for me). I learned a lot from this competition, and to be honest, I'm just a newbie in machine learning and time series research. I met a lot of talent here
[@cdeotte](https://www.kaggle.com/cdeotte)
[@kaggleqrdl](https://www.kaggle.com/kaggleqrdl)
[@joshuascj](https://www.kaggle.com/joshuascj)
[@titericz](https://www.kaggle.com/titericz)
[@batprem](https://www.kaggle.com/batprem)
[@vitalykudelya](https://www.kaggle.com/vitalykudelya)
. Too many friends for me to put them all here.
They kindly shared good baselines, ideas and data, which taught me a lot. I must say that we have reached such score by standing on the shoulders of giants.
1. solution:
1.1. ideas
Our team used GRU blending with XGBoost as a solution.
The composition of time series data is probably: (this is my understanding, I hope there is no error in expression)
$$timeseries=trend+otherinformantion+noise$$
The general idea is to use GRU to capture the "trend" information of the data, and XGBoost to capture "other information".
Expressed in pseudocode:
Fit stage
GRU. fit(trend_data)
XGB.train(X_XGB[other_information_features], residual_data)
Inference stage
residual_data_pred=XGB.predict(X_XGB[other_information_features])
trend_data_pred = GRU. predict(X_GRU)
sub_data_pred=trend_data_pred +residual_data_pred
1.2. Cross-validation
When we train GRU, I predict 5 months totally. I use rolling-window CV method for 5 times.
Results:
1st month: 1.333; 3rd month: 2.47; 4th month: 2.95; 5th month: 3.39
When we train XGB, we use Group CV results for 3 times.
Results:
1st month: Nan; 3rd month: 2.34; 4th month: 2.74; 5th month: 3.12
Improve:
Results:
1st month: Nan; 3rd month: 0.13; 4th month: 0.20; 5th month: 0.26
1.3. LB tests:
Also, I use LB to determine my CV’s performance.
I treat January (LB) as "March", "April" and "May" respectively to output the results. (Just slide the GRU forecast starting point backwards from 2022-12-01.)
Only GRU results:
3rd month: 2.82, 4th month: 3.15, 5th month: 3.4
GRU blending XGB
: 3rd month: 2.66, 4th month:2.8, 5th month: 2.5
Improve
: 3rd month: 0.16, 4th month:0.35, 5th month: 0.9 (Maybe this is somehow the luck)
1.4. Conclusion
Both CV score and LB score all get improvement. XGB can help GRU. Thank you.
Good luck to us.