Giter VIP home page Giter VIP logo

butchtm / unicef-ai4d-poverty-mapping Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thinkingmachines/unicef-ai4d-poverty-mapping

0.0 0.0 0.0 114.75 MB

UNICEF AI4D Poverty Mapping Project - datasets, models, and scripts for building poverty estimation models across Southeast Asia (SEA)

Home Page: https://thinkingmachines.github.io/unicef-ai4d-poverty-mapping

License: MIT License

Python 0.24% CSS 0.01% Makefile 0.01% Jupyter Notebook 99.76%

unicef-ai4d-poverty-mapping's Introduction

UNICEF AI4D Poverty Mapping Project

Python Code style: black



๐Ÿ“œ Description

The UNICEF AI4D Poverty Mapping Project aims to develop open datasets and machine learning (ML) models for poverty mapping estimation across nine countries in Southeast Asia (SEA).

We also aim to open source all the scripts, experiments and other artifacts used for developing these datasets and models in order to allow others to replicate our work as well as to collaborate and extend our work for their own use cases.

This project is part of Thinking Machines's overall push for open science through the AI4D (AI for Development) Research Bank which aims to accelerate the development and adoption of effective machine learning (ML) models for development across Southeast Asia.

Documentation geared towards our methodology and experiments can be found here.



๐Ÿ’ป Replicating model training and rollout for a country

Our final trained models and their use to produce nationwide estimates can replicated through our notebooks, assuming you've followed the Data and Local Development setup below.

All the output files (models, datasets, intermediate files) can all be downloaded from here.



๐Ÿ“š Data Setup

DHS Data

Due to the sensitive nature of the data and the DHS program terms of use, we cannot provide the raw DHS data used in our experiments.

You will have to request for access to raw data yourself on the DHS website.

Generally, for all the experiment notebooks in this repo, they assume that the DHS Stata and Shape zip files contents are unzipped to its own folder under data/dhs/<iso-country-code>/ where the <iso-country-code> is the two-letter ISO country code.

For example, from the data for the Philippines will have this directory structure:

data/
    dhs/
        ph/
            PHGE71FL/
                DHS_README.txt
                GPS_Displacement_README.txt
                PHGE71FL.cpg
                PHGE71FL.dbf
                PHGE71FL.prj
                PHGE71FL.sbn
                PHGE71FL.sbx
                PHGE71FL.shp
                PHGE71FL.shp.xml
                PHGE71FL.shx
            PHHR71DT/
                PHHR71FL.DCT
                PHHR71FL.DO
                PHHR71FL.DTA
                PHHR71FL.FRQ
                PHHR71FL.FRW
                PHHR71FL.MAP

If you create your own notebook, of course you are free to modify these conventions for filepaths yourself. But out-of-the-box, this is what our notebooks assume.

Night Lights from EOG

The only other data access requirement is for the EOG Nightlights Data which requires registering for an account. The notebooks require the use of these credentials (user name and password) to download the nightlights data automatically.

General Dataset Notes

All the other datasets used in this project are publically available and the notebooks provide the code necessary to automatically download and cache the data.

Due to the size of the datasets, please make sure you have enough disk space (minimum 40GB-50GB) to accommodate all the data used in building the models.



โš™๏ธ Local Setup for Development

This repo assumes the use of miniconda for simplicity in installing GDAL.

Requirements

  1. Python 3.9
  2. make
  3. miniconda

๐Ÿ One-time Set-up

Run this the very first time you are setting-up the project on a machine to set-up a local Python environment for this project.

  1. Install miniconda for your environment if you don't have it yet.
wget "https://repo.anaconda.com/miniconda/Miniconda3-latest-$(uname)-$(uname -m).sh"
bash Miniconda3-latest-$(uname)-$(uname -m).sh
  1. Create a local conda env and activate it. This will create a conda env folder in your project directory.
make conda-env
conda activate ./env
  1. Run the one-time set-up make command.
make setup
  1. To test if the setup was successful, run the tests. You should get a message that all the tests passed.
make test

At this point, you should be ready to run all the existing notebooks on your local.

๐Ÿ“ฆ Dependencies

Over the course of development, you will likely introduce new library dependencies. This repo uses pip-tools to manage the python dependencies.

There are two main files involved:

  • requirements.in - contains high level requirements; this is what we should edit when adding/removing libraries
  • requirements.txt - contains exact list of python libraries (including depdenencies of the main libraries) your environment needs to follow to run the repo code; compiled from requirements.in

When you add new python libs, please do the ff:

  1. Add the library to the requirements.in file. You may optionally pin the version if you need a particular version of the library.

  2. Run make requirements to compile a new version of the requirements.txt file and update your python env.

  3. Commit both the requirements.in and requirements.txt files so other devs can get the updated list of project requirements.

Note: When you are the one updating your python env to follow library changes from other devs (reflected through an updated requirements.txt file), simply run pip-sync requirements.txt

๐Ÿ“œDocumentation

We are using Quarto to maintain the Unicef AI4D Poverty Mapping documentation site.

Here are some quick tips to running quarto/updating the doc site, assuming you're on Linux.

For other platforms, please refer to Quarto's website.

  • Download:
wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.2.247/quarto-1.2.247-linux-amd64.deb
  • Install:
sudo dpkg -i quarto-1.2.247-linux-amd64.deb
quarto preview --port 4444 --no-browser
  • Update the site (must have maintainer role):
quarto publish gh-pages --no-browser
  • Pro-tip : If you are using VS Code as your code editor, install the Quarto extension to make editing/previewing the doc site a lot smoother.

unicef-ai4d-poverty-mapping's People

Contributors

butchtm avatar tm-jc-nacpil avatar alronlam avatar tm-jace-peralta avatar ardieorden avatar levymedina avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.