Software Open Access

Code implementation of the feature and prior shift adjustment method proposed in "Two Shifts for Crop Mapping: Leveraging Aggregate Crop Statistics to Improve Satellite-based Maps in New Regions"

Kluger, Dan M.

Here we post an R implementation of the prior and feature shift adjustment methods from Section 2 of Kluger et. al. (2021).  The methods leverage prior information about the distribution of the crop type labels in each region. In our case, this prior information is based aggregate-level government statistics.

This upload includes R code with a function to implement the prior and feature shift adjustment methods. It also includes 3 example implementations of the method. The prior and feature shift adjustment method can be used for any choice of base classifier as long as that classifier outputs the posterior probability of each target point being in each class. In our examples, we exhibit the method's use for settings where LDA or Random Forest is the base classifier.

The .pdf and .html files in this Zenodo post are the same. The data used in the tutorial can be found here: 10.5281/zenodo.6376160. The paper Kluger et. al. (2021) can also be found on arXiv:


Preferred Citation:

Kluger, D.M., Wang, S., Lobell, D.B., 2021. Two shifts for crop mapping: Leveraging aggregate crop statistics to improve satellite-based maps in new regions. Remote Sens. Environ. 262, 112488.


Files (905.1 kB)
Name Size
678.6 kB Download
208.9 kB Download
17.6 kB Download
All versions This version
Views 124124
Downloads 9797
Data volume 20.5 MB20.5 MB
Unique views 120120
Unique downloads 9292


Cite as