The viewer is disabled because this dataset repo requires arbitrary Python code execution. Please consider
removing the
loading script
and relying on
automated data support
(you can use
convert_to_parquet
from the datasets
library). If this is not possible, please
open a discussion
for direct help.
USA County Level Crop Yield Dataset
Dataset Summary
This dataset contains county level crop yield across 763 counties from 1984 till 2018 in the US Corn Belt. The data was originally collected in Khaki et al. 2020, then further processed, augmented dedup-ed in Hasan et al. 2024.
Here are the 9 unique states in the dataset:
- Illinois
- Indiana
- Iowa
- Kansas
- Minnesota
- Missouri
- Nebraska
- North Dakota
- South Dakota
Each row of the CSV includes:
- Weather: 6 weekly mean weather variables over 52 weeks for each of the past
n_past_years + 1
years.- The 6 weather variables (
W_1-W_6
) are precipitation, solar radiation, snow water equivalent, maximum temperature, minimum temperature, and vapor pressure. - Each variable has a subindex (1 to 52) denoting its week of the year. For instance column
W_1_1
represents precipitation of week 1 of the year.
- The 6 weather variables (
- Practices: 14 agricultural practices for each year For Soybean only
- Soil: 11 soil measurements at 6 depths.
- Year & Coordinates: Year of observation and (latitude, longitude) of the country centroid.
- Crop Yield: County level Yield for Corn, Soybeans and Winter Wheat. (measured in Bu/Acre) Note: Some yields are missing and we ommit those values in the dataloader.
Please refer to Khaki et al. 2020 for the description of the measurements. Please see the sample csv to understand dataset columns.
Intended Tasks
- Crop Yield Prediction
- Time-Series Forecasting
- Multi-modal Regression
Dataset Structure
Each data point contains:
Splits
We recommend Doing 5-Fold cross validation with testing on the years 2014-2018. In other words, in the first fold, use training data until 2013, test on 2014, then in the second fold, train until year 2014, and test on 2015 and so on.
Usage
from datasets import load_dataset
from torch.utils.data import DataLoader
# Load corn dataset with custom parameters passed directly
corn_dataset = load_dataset(
"notadib/usa-corn-belt-crop-yield",
crop_type="corn", # corn, soybean or winter_wheat
test_year=2014, # min 1984 max 2018
n_train_years=5, # how many years to include in training
n_past_years=2, # how many past years to include per example
standardize=True,
trust_remote_code=True,
)
print(f"Corn training samples: {len(corn_dataset['train'])}")
print(f"Corn test samples: {len(corn_dataset['test'])}")
# Use DataLoader to get batches of size 32
train_loader = DataLoader(corn_dataset["train"], batch_size=32)
for batch in train_loader:
weather = batch["weather"] # [batch size, (n_past_years + 1) * 52, 31]
weather_mask = batch["weather_mask"] # [batch size, (n_past_years + 1) * 52, 31]
coords = batch["coords"] # [batch size, (n_past_years + 1) * 52, 2]
years = batch["years"] # [batch size, (n_past_years + 1) * 52, 1]
interval = batch["interval"] # [batch size, (n_past_years + 1) * 52, 1]
soil = batch["soil"] # [batch size, (n_past_years + 1), 6, 11]
y_past = batch["y_past"] # [batch size, (n_past_years + 1), 1]
y = batch["y"] # [batch size, 1]
print(weather.shape)
print(weather_mask.shape)
print(coords.shape)
print(years.shape)
print(interval.shape)
print(soil.shape)
print(y_past.shape)
print(y.shape)
break
Sources
- Khaki S, Wang L and Archontoulis SV (2020) A CNN-RNN Framework for Crop Yield Prediction. Front. Plant Sci. 10:1750. doi: 10.3389/fpls.2019.01750
- USDA Crop Yield
- Hasan A, Roozbehani M, and Dahleh M (2024) WeatherFormer: A Pretrained Encoder Model for Learning Robust Weather Representations from Small Datasets
Citation
Please cite both the original paper and the processing described in our paper
@article{Khaki2020CNNRNN,
author = {Khaki, Saeed and Wang, Liang and Archontoulis, Sotirios V.},
title = {A CNN-RNN Framework for Crop Yield Prediction},
journal = {Frontiers in Plant Science},
volume = {10},
pages = {1750},
year = {2020},
doi = {10.3389/fpls.2019.01750},
publisher = {Frontiers Media SA}
}
@misc{hasan2024weatherformerpretrainedencodermodel,
title={WeatherFormer: A Pretrained Encoder Model for Learning Robust Weather Representations from Small Datasets},
author={Adib Hasan and Mardavij Roozbehani and Munther Dahleh},
year={2024},
eprint={2405.17455},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2405.17455},
}
- Downloads last month
- 91