Giter Club home page Giter Club logo

handan-nader_cafo_public's Introduction

Replication code for "Deep Learning to Map Concentrated Animal Feeding Operations" (Nature Sustainability, forthcoming)

The code and data in this repository will replicate the tables and figures in the main body of "Deep Learning to Map Concentrated Animal Feeding Operations." The replication code is designed to work on macOS.

Attribution

When using these models and/or the underlying data, please cite the paper above with mention that the location data used to train the models was developed by the Environmental Working Group and Waterkeeper Alliance, with validation by the research team at Stanford.

Requirements

  1. The python code requires the dependencies in the cafo_environment.yml file. To replicate this environment, install the open-source anaconda distribution, navigate to the top level of the replication directory, and run
conda env create --name cafo -f=environments/cafo_environment.yml
  1. The R code was developed using the session described in environments/r_session_info. Upon execution, the R scripts will automatically to try to install the required packages and their dependencies.
  2. Figure 5 requires a Google Maps Static API key, which the script will ask for. Instructions on how to obtain one are provided in the Google Maps Platform documentation.

Naming conventions

Each script that creates a table or a figure is named for the figure or table it creates in the manuscript as it appears in the raw tex file. The naming convention is [Item number]_[item_type]_[item name]. The script create_cafo_facilities.py replicates the facility consolidation algorithm that was run after the class activation mapping and rescoring process demonstrated in 3_Figure_fgcam_CAM_Algorithm_Illustration.py.

Instructions

To replicate all figures and tables, open a bash shell and activate the python virtual environment created from cafo_environment.yml. Navigate to the top level of the replication directory and run:

chmod u+x code/replicate_all.sh
./replicate_all.sh

The variable names and descriptions of all variables in the csv files are included in data/csv/codebook.xlsx.

handan-nader_cafo_public's People

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.