Installation¶
This guide covers setting up AirSense ML for local development.
Prerequisites¶
| Tool | Version | Install |
|---|---|---|
| Python | 3.12+ | python.org |
| uv | latest | brew install uv |
| Docker | latest | docker.com |
| Git | latest | git-scm.com |
1. Clone the Repository¶
2. Create Virtual Environment¶
This creates .venv/ using Python 3.12. If you have a .python-version file it reads the version from there.
3. Install Dependencies¶
Full install (local development — includes training tools):
This installs:
- Production deps — FastAPI, scikit-learn, XGBoost, LightGBM, Loguru, Pydantic
- Training group — MLflow, Optuna, SHAP, Matplotlib, Seaborn
- Dev group — Ruff, pre-commit, Jupyter, questionary
Production only (API serving, no training tools):
4. Install Pre-commit Hooks¶
This installs: - Ruff linting and formatting on every commit - Conventional commit message enforcement
5. Set Up Environment¶
Open .env.dev — defaults work for local development. No changes required to get started.
6. Download Dataset¶
Download the Delhi AQI dataset from Kaggle:
Delhi NCR Air Quality & Pollution Dataset 2020–2025
Place the CSV file in data/raw/:
7. Track Data with DVC¶
uv run dvc add data/raw
git add data/raw.dvc data/.gitignore
git commit -m "chore: track raw data with DVC"
Verify Installation¶
If all three run without errors — installation is complete.
Troubleshooting¶
zsh: command not found: dvc
DVC is installed in the virtual environment. Use uv run dvc or activate the venv:
brew install libomp required on macOS
LightGBM requires OpenMP on macOS:
ModuleNotFoundError: No module named src
Make sure you're running from the project root, not inside src/: