# 10 days bronze (63 place solution)

tl;dr: New baseline from raw data > Recalculate all pipelines on the best ensemble > Snap SJC to ground true
Hello everyone, i wanted to share the steps i took to get the bronze medal, i only started working on this competition 10 days before the deadline and mostly used work from the community to get my final score, so i'll also leave my special thanks to the ones who shared the knowledge i used.
[@jeongyoonlee](https://www.kaggle.com/jeongyoonlee)
for this great baseline
[https://www.kaggle.com/jeongyoonlee/google-smartphone-decimeter-eda-keras-tpu](https://www.kaggle.com/jeongyoonlee/google-smartphone-decimeter-eda-keras-tpu)
[@bpetrb](https://www.kaggle.com/bpetrb)
for this amazing notebook
[https://www.kaggle.com/bpetrb/adaptive-gauss-phone-mean/output](https://www.kaggle.com/bpetrb/adaptive-gauss-phone-mean/output)
[@taroz1461](https://www.kaggle.com/taroz1461)
for his clustering technique
[https://www.kaggle.com/c/google-smartphone-decimeter-challenge/discussion/245160](https://www.kaggle.com/c/google-smartphone-decimeter-challenge/discussion/245160)
[@t88take](https://www.kaggle.com/t88take)
for this great notebook
[https://www.kaggle.com/t88take/gsdc-phones-mean-prediction/output](https://www.kaggle.com/t88take/gsdc-phones-mean-prediction/output)
[@tensorchoko](https://www.kaggle.com/tensorchoko)
for her multioutput regressor, i believe she removed the notebook since i can't find it anymore
[@somayyehgholami](https://www.kaggle.com/somayyehgholami)
for this amazing ensemble notebook
[https://www.kaggle.com/somayyehgholami/gsdc-smart-ensembling](https://www.kaggle.com/somayyehgholami/gsdc-smart-ensembling)
The combined output from those notebooks plus a little original code granted me the medal, this is how it was done:
1 - Get a better baseline
On the first day of my research when i was trying to understand the data, i could see people talking about the
base_locations_test.csv
file was a good starting point and doing many post-processing techniques on it, so if i could find a better baseline, i could just apply the same public techniques people were doing and i would probably end up with a better result, so i spend some time trying to find someone who had calculated the baseline again, i end up finding a fork of
[@jeongyoonlee](https://www.kaggle.com/jeongyoonlee)
code and after a few tweaks, i ended up with a
slightly better LB score
than the raw file, so in theory that could give me a little edge.
2 - Finding a tweakable pipeline
[@bpetrb](https://www.kaggle.com/bpetrb)
provided us with a pipeline that were strongly connected with some hyperparameters (i actually got a fork of it), after a night cycling trough a few, i found out that the guy did a good job setting the parameters,
i couldn't improve his score
by changing the parameters alone.
3 - Clustering the data and setting hyperparameters
After that failed attempt i found
[@taroz1461](https://www.kaggle.com/taroz1461)
comment explaining how he
clustered the datasets
, i used his logic 'as-is' and tried a new combinations of hyperparameters for each cluster, after a while i found a
better set of parameters
for the highway cluster, since that one was one of the biggest, the improvement was substantial.
4 - Finding a good ensembling
At the time,
[@somayyehgholami](https://www.kaggle.com/somayyehgholami)
had a very good ensemble pipeline that were using the same post-processing that i improved before
(step 3)
as one of its inputs, so i figured that if i already had a better baseline, maybe i could
recalculate the same inputs
that she was using and combine with the best set of hyperparameters that i had.
5 - Checking the outputs and snapping to grid
During all steps i was constantly checking the outputs on the map, the SJC paths were always very messy and out of the road, so reading the forums, i found that i could implement a **snap to grid **process *(something that i saw before on the indoor competition)* and people were also talking about here, but i couldn't find any public notebook that could do this the way i wanted to, so
i had to code this part
.
This is basically the only original code on my solution, since i was out of time
(2 days left)
, i decided to implement this
without interpolations and only on SJC
, using the provided ground true as grid points (they are dense on SJC), it ended up increasing my score by a good amount, the table below is showing the change it made, so i was confortable submitting that as my final submission.
Now, looking at the private dataset, this little change ended up giving me a much needed
0.1 on LB
, that is almost the exact difference between my position and the 100 place.
Without snap
With snap
![](assets/8c73ae826ff295e0a95a4fd8.png)
![](assets/ddba230d45b0c8a377147316.png)
So that was my final submission, i tried to interpolate the ground true points to create more snapping targets, but i just ran out of time, luckily the public and private LB ended up improving together, so my best private score was indeed my best public one.
Thank you everyone to read until the end, i'm sorry if i didn't gave credit to someone who was forked before the guys i forked, if so, please comment, i'll gladly extend my thanks to you too!