perfectcity.aiyo

The data science behind your result

perfectcity.aiyo is a way for you to discover your ideal city.

This project was built for the ChallengePost Open Data Summer Jam.

The result of the perfectcity.aiyo quiz is based on real data carefully curated from Statistics Canada and a few other sources. We worked hard to ensure that the data is the most recent we could find in order to give you the best results.

We have carefully crafted questions to help our algorithm decide the best city for you to live in. Here's our methodology behind the questions and how our algorithm works.

We first ask you for your current city to ensure we don't match you to your current city! (If you want to know if your current city is the right place for you, just leave it out and our algorithm will take care of the rest.)

Your age is used to match you to a city with simillar proportions of its population as your age group. Our data has a resolution of 5 years to ensure we get the best results.

We then ask you a series of yes/no questions. These determine the weights of the algorithm. Are you looking for a job? Yes? We then place a higher weight on employment data. Want to study? We try to maximize the number of universities in your perfect city.

Our next page consists of sliders which ask you to score parameters that we have for our cities. These help calculate the similarity between your ideal city and those that exist currently.

Our algorithm then calculates the the similarity between you and every other city in our database based on a modification of the inverse weighted eucledian distance. This is the math:
\[\text{similarity}(x^*,x)=\frac{1}{1+\sqrt{\sum_iw_i(x_i^*-x_i)^2}}\]
- $($x_i^*$)$ is your preference for the $($i$)$th parameter.
- $($x_i$)$ is $($i$)$th parameter for the city we are comparing it to
- $($w_i$)$ represents the personalized weight that we determined for you.

Once our algorithm completes calculating these similarities, it then maximizes the list to return the city with the highest similarity to you. And thats it!

In the future we would like to incorporate weather, cultural and business data and ofcourse more information from other cities around the world! There are also opportunities to use a Twitter sentiment analysis to analyze what people are feeling about their city in real time and incorporate that into the algorithm.

The curated data set is available on the github. Enjoy!


Take the Quiz