Visualizing Homelessness in Toronto

Part of an attempt at applying data science to ‘bigger’ problems than business or tech

Is it mostly adult males who are at risk for homelessness? Where are shelter programs in the city and how many people do they serve?

Data Science for Humanity

During my undergrad in Waterloo I was exposed to the realities of homelessness in the city. Initially through daily life and mostly with adult men, which led me to volunteering a bit of time for a couple of events at a shelter. I quickly learnt about the deeper extent of homelessness, including the variety of groups that are affected and reliant on non-profit and city funded programs.

Many of us are largely ignorant of these services, as well as the depth of the problem itself. Based on your day-to-day, you may have a narrow perception of things, just as my initial view of homelessness mostly affecting adult males.

I’ve separately wanted to explore some of the datasets that the City provides through it’s (excellent) Open Data program. You have probably interacted with this service (albeit unknowingly) as it powers a number of apps such as transit times, or the bike share network. Finding a dataset on shelter services and occupancy prompted me to develop a simple app to shed some light on the issue.

Why an app on homelessness? – This is a bit of a silly question, but my intentions stem from an effort to apply some of my time and capabilities to something a bit more meaningful and substantive .. sort of as a response to the question I sometimes ask myself “what positive impact am I having on my community?”. The main point here is that I feel the potential of modern data science can extend beyond (mostly) business and tech to the realms of ‘grander’ problems. The deeper problems we face in our current era; especially the ones affecting groups who are not typically beneficiaries of modern tools.

With that, let me lay out the details in a more organized fashion.

The App

Question

Where are shelter programs offered in the city? Crucially, how does occupancy trend over time by group?

We can enrich the core dataset with location variables that will allow us to visualize the data layered onto a map, which provides a useful representation of “where”.

Further, we can focus on occupancy as a proportion of capacity, to make it easier to observe if existing programs meet demand or not (by group, of course); for example, is there sufficient capacity for families? How does occupancy for women’s programs vary relative to men’s?

Dataset

Toronto Shelter Data Feed

As mentioned, the app is powered by the shelters dataset through the city’s Open Data program, which updates daily the facility, program name, and capacity and occupancy. The occupancy is taken the following day at 4a, so for example today’s occupancy will be a tally of number in attendance at 4a tomorrow. I’ve used the facility and address information to populate the latitude/longitude data and merged it into the table. Finally, I use the time series to determine average monthly metrics displayed on the map, and then plot the daily occupancy for each shelter to highlight trends within each group.

Analysis

How is the app created and what does it provide?

I’m utilizing shiny for the app, and Leaflet for the main visualization (via leaflet for R) as well as ggplot2. The app highlights location, as well as average monthly capacity using circles on the map (larger the circle, larger the average capacity of the shelter). It also provides a daily breakdown of occupancy per shelter for the month based on the date selected.

The following snippet gives a flavour of the app; showing capacity averages and locations for a subset of shelters across each group for the month of June:

Visit the shelters app here.

Avatar
Khalil H Najafi
Artistically Scientific with Data

Randomly walking through a career in data science, understanding statistics (the plight is real), and hoping to leave a positive mark on the space(s) I occupy

Related