I Trained a Model to Predict Austin Trail Usage, and It Told Me to Stay Home When It’s Cloudy!

John WalleyJohn Walley
2 min read

Background

Apparently Austin has some sensors counting your trail usage, and the data is available at the Austin open data portal.

Trail Counters Device Locations

Trail Counters Daily Totals

I took that along with historical weather data from Open-meteo and trained an XGBoost model to predict future trail counts based on forecasted weather. This isn’t that interesting of a problem, but here’s a Binder link if you want to play around with it.

Streamlit

The model gave me an excuse to deploy a Streamlit app (for free) to their Community Cloud. I wanted to see if it was possible to get a table with histograms displayed in it. The answer was yes.

Running a Streamlit app

If you've never used it, you can develop and run them locally. It’s just a Python script.

The repo for this ThatOrJohn/austin-trail-forecast

With your repo ready, you can deploy it to their cloud in a couple of steps

The deployed product.

Histograms

The app displays multiple things, but the main interest here was the Historical Distribution column below.

Thought it might be a nice way to show the predicted value in the context of the historical trail counts. Could probably benefit from some more formatting, but I’ll stick it in the potentially useful in the future bucket.

Easter Egg

While browsing through the Streamlit docs I saw

st.snow()

I had to tuck away a little surprise if someone happens to look at the app when the forecast is below 33F with precipitation.

0
Subscribe to my newsletter

Read articles from John Walley directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

John Walley
John Walley