Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created new dataset North Uganda 2020 #415

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions data/datasets.dvc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
outs:
- md5: 255771180339afd476bb65d11d0406e5.dir
size: 745188620
nfiles: 62
- md5: ebe078dafe84bf33fd0b6244a5d96976.dir
size: 750599973
nfiles: 63
path: datasets
hash: md5
6 changes: 3 additions & 3 deletions data/raw.dvc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
outs:
- md5: 0916e33f6eef6c80a87e319427005f5e.dir
size: 446720790
nfiles: 408
- md5: b5b44ce605c7cd43d7e94d2778d8d34a.dir
size: 447063610
nfiles: 410
path: raw
hash: md5
9 changes: 9 additions & 0 deletions data/report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -519,3 +519,12 @@ eo_data_complete 1000
✔ training amount: 387, positive class: 1.3%
✔ validation amount: 294, positive class: 1.0%
✔ testing amount: 319, positive class: 1.3%



Uganda_NorthCEO2020 (Timesteps: 24)
----------------------------------------------------------------------------
eo_data_complete 1000
✔ training amount: 387, positive class: 11.9%
✔ validation amount: 294, positive class: 7.8%
✔ testing amount: 319, positive class: 7.8%
33 changes: 33 additions & 0 deletions datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,38 @@ def load_labels(self) -> pd.DataFrame:
return df


class Uganda_NorthCEO2020(LabeledDataset):
def load_labels(self) -> pd.DataFrame:
raw_folder = raw_dir / "Uganda_North_2020"
df1 = pd.read_csv(
raw_folder
/ "ceo-UNHCR-North-Uganda-Feb-2020---Feb-2021-(Set-1)-sample-data-2024-11-27.csv"
)
df2 = pd.read_csv(
raw_folder
/ "ceo-UNHCR-North-Uganda-Feb-2020---Feb-2021-(Set-2)-sample-data-2024-11-27.csv"
)
df = pd.concat([df1, df2])

# Discard rows with no label
df = df[~df["Does this pixel contain active cropland?"].isna()].copy()
df[CLASS_PROB] = df["Does this pixel contain active cropland?"] == "Crop"
df[CLASS_PROB] = df[CLASS_PROB].astype(int)
df["num_labelers"] = 1
df = df.groupby([LON, LAT], as_index=False, sort=False).agg(
{
CLASS_PROB: "mean",
"num_labelers": "sum",
"plotid": join_unique,
"sampleid": join_unique,
"email": join_unique,
}
)
df[START], df[END] = date(2019, 1, 1), date(2020, 12, 31)
df[SUBSET] = train_val_test_split(df.index, 0.3, 0.3)
return df


class Uganda_NorthCEO2021(LabeledDataset):
def load_labels(self) -> pd.DataFrame:
raw_folder = raw_dir / "Uganda_North_2021"
Expand Down Expand Up @@ -1571,6 +1603,7 @@ def load_labels(self) -> pd.DataFrame:
FranceCropArea2020(),
Uganda_NorthCEO2016(),
Uganda_NorthCEO2017(),
Uganda_NorthCEO2020(),
]

if __name__ == "__main__":
Expand Down
Loading