Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -176,6 +176,53 @@ Data from:
|
|
| 176 |
|
| 177 |
> Dulce Rubio et al. "[RELand: Risk Estimation of Landmines via Interpretable Invariant Risk Minimization](https://arxiv.org/abs/2311.03115)." *ACM Journal on Computing and Sustainable Societies* 2.2 (2024): 1–29.
|
| 178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
## Dataset Summary
|
| 180 |
|
| 181 |
| Property | Value |
|
|
@@ -302,53 +349,6 @@ These are binary (0/1) indicator columns derived from three categorical variable
|
|
| 302 |
| La Unión | 678 | 2.5% |
|
| 303 |
| Alejandría | 519 | 1.9% |
|
| 304 |
|
| 305 |
-
## Usage
|
| 306 |
-
|
| 307 |
-
### Loading with 🤗 Datasets
|
| 308 |
-
|
| 309 |
-
```python
|
| 310 |
-
from datasets import load_dataset
|
| 311 |
-
|
| 312 |
-
ds = load_dataset("cmpatino/landmine-detection")
|
| 313 |
-
df = ds["train"].to_pandas()
|
| 314 |
-
|
| 315 |
-
# Features and target
|
| 316 |
-
X = df.drop(columns=["LATITUD_Y", "LONGITUD_X", "Municipio", "mines_outcome"])
|
| 317 |
-
y = df["mines_outcome"]
|
| 318 |
-
|
| 319 |
-
print(f"Samples: {len(df)}, Features: {X.shape[1]}, Positive rate: {y.mean():.3%}")
|
| 320 |
-
# Samples: 26761, Features: 63, Positive rate: 1.607%
|
| 321 |
-
```
|
| 322 |
-
|
| 323 |
-
### Loading directly with pandas
|
| 324 |
-
|
| 325 |
-
```python
|
| 326 |
-
import pandas as pd
|
| 327 |
-
|
| 328 |
-
df = pd.read_parquet(
|
| 329 |
-
"hf://datasets/cmpatino/landmine-detection/data/train-00000-of-00001.parquet"
|
| 330 |
-
)
|
| 331 |
-
|
| 332 |
-
# Quick overview
|
| 333 |
-
print(df.shape) # (26761, 67)
|
| 334 |
-
print(df.dtypes.value_counts())
|
| 335 |
-
# float64 30
|
| 336 |
-
# int64 37
|
| 337 |
-
|
| 338 |
-
# Target distribution
|
| 339 |
-
print(df["mines_outcome"].value_counts())
|
| 340 |
-
# 0 26331
|
| 341 |
-
# 1 430
|
| 342 |
-
|
| 343 |
-
# Contamination rate per municipality
|
| 344 |
-
print(
|
| 345 |
-
df.groupby("Municipio")["mines_outcome"]
|
| 346 |
-
.mean()
|
| 347 |
-
.sort_values(ascending=False)
|
| 348 |
-
.head()
|
| 349 |
-
)
|
| 350 |
-
```
|
| 351 |
-
|
| 352 |
## Validation Protocols
|
| 353 |
|
| 354 |
The RELand paper proposes three validation protocols that account for the spatial structure of the data and simulate real demining operations:
|
|
|
|
| 176 |
|
| 177 |
> Dulce Rubio et al. "[RELand: Risk Estimation of Landmines via Interpretable Invariant Risk Minimization](https://arxiv.org/abs/2311.03115)." *ACM Journal on Computing and Sustainable Societies* 2.2 (2024): 1–29.
|
| 178 |
|
| 179 |
+
## Usage
|
| 180 |
+
|
| 181 |
+
### Loading with 🤗 Datasets
|
| 182 |
+
|
| 183 |
+
```python
|
| 184 |
+
from datasets import load_dataset
|
| 185 |
+
|
| 186 |
+
ds = load_dataset("cmpatino/landmine-detection")
|
| 187 |
+
df = ds["train"].to_pandas()
|
| 188 |
+
|
| 189 |
+
# Features and target
|
| 190 |
+
X = df.drop(columns=["LATITUD_Y", "LONGITUD_X", "Municipio", "mines_outcome"])
|
| 191 |
+
y = df["mines_outcome"]
|
| 192 |
+
|
| 193 |
+
print(f"Samples: {len(df)}, Features: {X.shape[1]}, Positive rate: {y.mean():.3%}")
|
| 194 |
+
# Samples: 26761, Features: 63, Positive rate: 1.607%
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
### Loading directly with pandas
|
| 198 |
+
|
| 199 |
+
```python
|
| 200 |
+
import pandas as pd
|
| 201 |
+
|
| 202 |
+
df = pd.read_parquet(
|
| 203 |
+
"hf://datasets/cmpatino/landmine-detection/data/train-00000-of-00001.parquet"
|
| 204 |
+
)
|
| 205 |
+
|
| 206 |
+
# Quick overview
|
| 207 |
+
print(df.shape) # (26761, 67)
|
| 208 |
+
print(df.dtypes.value_counts())
|
| 209 |
+
# float64 30
|
| 210 |
+
# int64 37
|
| 211 |
+
|
| 212 |
+
# Target distribution
|
| 213 |
+
print(df["mines_outcome"].value_counts())
|
| 214 |
+
# 0 26331
|
| 215 |
+
# 1 430
|
| 216 |
+
|
| 217 |
+
# Contamination rate per municipality
|
| 218 |
+
print(
|
| 219 |
+
df.groupby("Municipio")["mines_outcome"]
|
| 220 |
+
.mean()
|
| 221 |
+
.sort_values(ascending=False)
|
| 222 |
+
.head()
|
| 223 |
+
)
|
| 224 |
+
```
|
| 225 |
+
|
| 226 |
## Dataset Summary
|
| 227 |
|
| 228 |
| Property | Value |
|
|
|
|
| 349 |
| La Unión | 678 | 2.5% |
|
| 350 |
| Alejandría | 519 | 1.9% |
|
| 351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
## Validation Protocols
|
| 353 |
|
| 354 |
The RELand paper proposes three validation protocols that account for the spatial structure of the data and simulate real demining operations:
|