Skip to content
Snippets Groups Projects
Duchateau Fabien's avatar
23b721a0

Predihood

Predihood is an application for visualizing IRIS (administrative areas defined by the French institute of statistics, they can be considered as neighbourhoods) and indicators which describe them (e.g. number of bakeries, average income and even the number of houses over 250m^2).

Statement of need

Finding a real estate in a new city is still a challenge. We often arrive in a city we don't know, thus finding the perfect living place becomes complex. Nearby public transport on one hand, a rural landscape on the other hand, an animated neighbourhood for some, far from urban hustle and bustle for others: there are many criteria for choosing your future neighbourhood. Our approach Predihood aims at facilitating the comparison between neighbourhoods. It defines and predicts the environment of any neighbourhood in France using supervised learning.

Installation instructions

Requirements

  • Python, version >=3
  • MongoDB, version >=4 for importing the database about neighbourhoods.

Installation

For installing Predihood, clone or download this git repository.

Go in the downloaded predihood/ directory (which contains setup.py) and run in a terminal:

python3 -m pip install -e . -r requirements.txt

This command install dependencies, including mongiris, a lightweight API which enables the querying of the MongoDB database containing information about French neighbourhoods. Note that the download time may be quite long, as the mongiris API includes a dump of French neighbourhoods (700 MB).

Next, to install the database, run the MongoDB server and execute this command (from the MongoDB's executables directory if needed):

./mongorestore --archive=/path/to/dump-iris.bin

where /path/to/ is the path to the dump file of the IRIS collection (provided with the package mongiris in mongiris/data/dump-iris.bin).

Run Predihood

For running Predihood, go in the predihood/predihood/ directory (which contains main.py) and run in a terminal:

python3 main.py

After some logging information, the terminal displays the URL for testing Predihood : http://localhost:8081/.

Example usage

For the cartographic interface, an example would be:

  1. Type a query in the panel on the left, e.g. "Lyon". This will display all neighbourhoods that contain "Lyon" in their name or their township.
  2. Click on a neighbourhood (which are the small areas in blue). A tooltip will appear with some information about the neighbourhood. There are more informations when clicking on the "More details" link.
  3. In order to predict the environment variables, you have to choose the classifier. The "Random Forest" classifier is recommended by default. After some seconds, predictions will appear in the tooltip. This will help you for comparing neighbourhoods between them.s

For the algorithmic interface, an example would be:

  1. Choose an algorithm
  2. Tune it as desired
  3. Click on "Train, test and evaluate" button. When computing accuracies is done, a table shows results for each environment variable and each list of indicators.

Tests

Tests are in tests.py file.