Logo Lanfrica

carlesmila/SEP-Mozambique

Domain:

socioeconomicgeospatial

Record type:

paper
Creator:
car
Host:
Code for the article "Predicting household socioeconomic position in Mozambique using satellite and household imagery" by C. Milà et al. # Predicting household socioeconomic position in Mozambique using satellite and household imagery This repository contains the code for the article "Predicting household socioeconomic position in Mozambique using satellite and household imagery" by C. Milà, T. Matsena, E. Jamisse, J. Nunes, Q. Bassat, P. Petrone, E. Sicuri, C. Sacoor, and C. Tonne. The manuscript is currently considered for publication; a preprint of the article is available on arXiv. To see the code corresponding to the preprint version of the article, please check the preprint branch of the repository. We used `R` version 4.2 and the package `ca` for the MCA to produce asset-based SEP. The rest of analyses were performed in `python` version 3.11.7 using the following modules: `pandas` for tabular data management; `geopandas` and `Rasterio` for spatial data management, `Pillow` for image data management, `PyTorch` and `torchvision` for computer vision deep learning models, `scikit-learn` and `xgboost` for machine learning models and workflows, `shap` for SHAP analyses, and `matplotlib` and `seaborn` for graphics. Other packages were used for additional minor tasks. ## R scripts The R scripts included in the R folder are the following: * assetindex.R: Script that creates the asset-based SEP measure using MCA. * study_area_map.R: Script that creates the study map figure included in the manuscript. ## Python scripts Python scripts are organised in two folders: preprocessing, where the code to clean the data can be found; and analysis for the analysis workflow. The preprocessing scripts are the following: * 1_parse_questionnaires.py: Script that cleans the raw questionnaire data, fixing data entry errors. * 2_order_photographs.py: Script that orders the image files according to their type. * 3_extract_aerial.py: Script that preprocesses the satellite data and extracts the 25m and 100m buffers around all household geocodes. The analysis scripts are the following: * 1_create_indices.py: Scrip …