Synthetic Agriculture Data for Africa
# **SAGDA**: Synthetic Agriculture Data in Africa
**SAGDA** (Synthetic Agriculture Data in Africa) is a Python library for generating, augmenting, and validating synthetic agricultural data for African regions. The library allows users to create realistic agricultural datasets, augment them using machine learning techniques, and validate the generated data against real data. SAGDA can also integrate real-world data from APIs like NASA POWER and OpenWeatherMap to enhance synthetic data generation.
## **Key Features**
- **Generate Synthetic Agricultural Data**: Create time-series datasets with geospatial, climate, soil, crop yield, and fertilizer information.
- **Augment Data**: Augment real agricultural datasets using machine learning techniques such as random sampling, interpolation, linear regression, autoencoders, and GANs.
- **Validate Data**: Validate synthetic data using statistical tests (e.g., KS test) and compare it against real data.
- **API Integration**: Fetch real-world climate data using NASA POWER and OpenWeatherMap APIs, or generate synthetic data based on user-specified parameters.
## **Installation**
You can install SAGDA from PyPI using `pip`:
```bash
pip install sagda
```
## **Dependencies**
- `pandas`
- `numpy`
- `requests`
- `scipy`
- `tensorflow`
- `scikit-learn`
## **Usage Examples**
### **1. Generate Synthetic Agricultural Data**
You can generate synthetic data using either random generation or real-world data from APIs (e.g., NASA POWER, OpenWeatherMap).
#### **Basic Usage** (Without API)
```python
from sagda import generate
# Generate synthetic data without API
data = generate(
num_records=12,
start_date="2020-01-01",
end_date="2020-12-31",
lat=34.0522,
lon=-118.2437,
crop_type="corn",
frequency='monthly'
)
print(data)
```
#### **Usage with NASA POWER API**
```python
from sagda import generate
# Generate synthetic data using NASA POWER API
data = generate(
start_date="2020-01-01",
end_date="2020-12-31",
lat=34.0522,
lon=-1 …