We put movement speeds and weather forecasts in a mixer — a quite revealing smoothie

TechLabs Düsseldorf
4 min readApr 13, 2022

This project was carried out as part of the TechLabs “Digital Shaper Program” in Düsseldorf (Winter Term 2021/22).

The concept

We noticed that some streets tend to have high traffic in certain weather conditions. To identify these streets we searched for data and found such in the form of Uber data frames and weather data from local providers. We merged the data, cleaned it and complemented it with the names of each street. Finally, after creating a regression model, we published the results on a website.

Traffic jams and thunderstorms

Your shift starts in 30 minutes and you are a bit late, heading to the car you notice it is raining and grab your umbrella. About ten minutes into the drive and you get stuck in a kilometre long traffic jam.

Hard to imagine that scenario? For us neither, so we looked at the topic more closely and tried to figure out what causes these inconvenient travel times. Something that quickly caught our attention, is that only some streets tend to cause this kind of trouble when it rains. But which ones?
And that is where our work begins and we dive into the data. To identify the problem streets we need data on how fast the cars move in each street. Additionally, we need to find out, when it rained, so that later we can try to look for connections
To summarize: A lot of data and a lot of diving.

Sample of our late-phase data

The ingredients for a smoothie with a bouquet of query and a regressing finish

So where did we get that much data? Well lucky for us we live in an age where smartphones are used as taxi clocks — sort of. The spoiler in the title gave it away: Uber datasets, available for free on this website, provided us with the necessary information. We downloaded the data for Berlin (given our resources we had to limit our project to one city) and took a closer look at it. Unfortunately — since street names are no good data keys — Uber uses id codes to identify streets and only has OSM ids (Open street map is a free volunteer-based map tool) as references to streets. Hence the first thing we had to do to complete the data with street names. Some puzzling query requests and a bunch of aspirin later we could pop in the last fruit for the smoothie: the weather data. Unfortunately, no weather service was as generous as Uber with its data and offered entire datasets. So we had to scrape it from a website with a script using selenium. Finally, with all ingredients in the pot, we were ready to blend it. We built a regression model that was set to calculate the speed on a street with the influence of rain. The accuracy of this prediction told us to what degree a street is influenced by the weather. This key step completed and the soothing smoothie smoothly blended, all that was left was to pour it into an appealing glass. Thus we built a website. Given the limited time and resources, we did not learn HTML and bought a server to host our site. Instead, we took advantage of the swiss army knife functionality of python — we used a module. Due to its easy to learn syntax and free hosting feature we chose streamlit. With its straightforward commands and pandas integration, it was a matter of days to get it up and running.

The most revealing, but maybe not the tastiest drink

So after all that data diving what did we get? well, we did get a quite presentable amount of information and we might actually be able to hint the commune of Berlin about the burning, or rather flooding spots they need to work on. A very impressive result, considering that we were a group of four more or less inexperienced dorks thrown at a task like this. There are some seeds in our drink though. For example that we set out to create an app that warns you when you can expect to be late to work because of bad weáther, or that the website does only present our data via search bar/data frame since the maps (for which we included a demo) require GPS coordinates, which we couldn’t extract from OSM with our resources. If, after all, we remind ourselves that the point of this undertaking was to learn…this was an incredibly rewarding project.

The demo map

https://share.streamlit.io/morpheusos/techlabs_group_4/main/website.py

GitHub repository: github.com/morpheusos/techlabs_group_4

The Team:

Georgios Emmanouilidis: Data Science (Python)

Joshua Nguyen: Data Science (Python)

Mahsa Khamanehasl: Data Science (Python)

Tim Eulenberg: Data Science (Python)

Fabian Schlüter: Mentor

--

--