Python toolkit for offshore wind project analysis: budget normalization, data quality validation, CAPEX/OPEX/LCOE calculation, ML-based CAPEX benchmarking, mapping, and new-project classification.
The project is designed as an end-to-end offshore wind decision-support prototype. It keeps the domain formulas transparent while adding source verification, confidence scoring, model validation, and reproducible reports.
- normalizes project budgets into
EUR 2026; - validates budget plausibility with
EUR/MWbounds; - ranks budget source quality with
A/B/C/Dverification levels; - applies manual curated overrides from
input/budget_overrides.csv; - handles combined budgets by allocating them proportionally by capacity;
- computes CAPEX, OPEX, CRF, annual production, and LCOE;
- classifies projects against validated historic projects;
- estimates a new project's budget with validated nearest neighbours;
- reports budget range, confidence score, confidence reasons, and outlier type;
- compares ML models against a median baseline.
.
├── input/
│ ├── european_offshore_wind_capex.csv
│ ├── wind_dataset.csv
│ └── budget_overrides.csv
├── examples/
│ └── new_project_500mw.json
├── output/
├── src/
│ ├── budget/
│ └── lcoe/
├── tests/
├── wind_budget.py
├── wind_farm_classifier.py
├── model_training.py
├── windAlgorithm.ipynb
├── METHODOLOGY.md
├── pyproject.toml
└── uv.lock
uv sync --group dev
cp .env.example .envSet a Serper API key in .env if you want to run web budget enrichment:
SERPER_API_KEY=your_serper_api_key_hereThe analysis and classifier can run from the existing cleaned dataset without rerunning web search.
The main dataset is:
input/wind_dataset.csv
Current budget quality fields include:
total_budget_raw- raw selected budget text;original_budget_raw- original dataset budget before enrichment/selection;total_budget_EUR_2026- normalized budget in EUR 2026;budget_EUR_per_MW- normalized budget per installed MW;budget_quality_status-valid,missing, orrejected;budget_source_type-declared_csv,internet_lookup,manual_override, ornone;budget_verification_level-A,B,C, orD;budget_confidence- numeric confidence score.
Verification levels:
A: official developer, regulator, government, EIB, or equivalent primary source;B: specialist industry source or curated declared dataset value;C: generic web lookup that passed plausibility checks but requires manual review;D: rejected or missing.
LCOE, budget estimation, and ML training use only A/B budget rows.
Manual budget corrections are stored in:
input/budget_overrides.csv
Schema:
wind_farm_name,budget_raw,budget_year,source_url,verification_level,notes
Run web budget enrichment:
uv run python wind_budget.py --input input/wind_dataset.csv --output-dir output --workers 5The script writes:
output/wind_dataset.csv
output/wind_dataset_budget_lookup_2026EUR.json
Do not blindly replace the input dataset with the output. Web lookup can find sector-wide or unrelated values. The quality layer prefers manual overrides and declared project-level budgets over weaker web lookup values.
Run the included 500 MW example:
uv run python wind_farm_classifier.py \
--dataset input/wind_dataset.csv \
--json examples/new_project_500mw.jsonThe classifier estimates budget from validated similar projects and writes:
output/classification_result.json
output/classification_preview.html
output/classification_history/
output/history/
The report includes:
- point budget estimate;
- budget range;
- confidence label and reasons;
- CAPEX/OPEX/LCOE metrics;
- outlier type;
- nearest historical project;
- ML model comparison and prediction.
Run model comparison:
uv run python model_training.py --dataset input/wind_dataset.csvThe training report compares:
- median baseline;
- Ridge regression;
- Random Forest;
- Histogram Gradient Boosting.
Target:
log(budget_EUR_per_MW)
Metrics:
- holdout MAE in
EUR/MW; - MAPE;
- R2 on log target;
- cross-validation MAE on log target;
- errors by country and foundation;
- feature importance where available.
The report is saved to:
output/model_training_report.json
uv run --with jupyter jupyter labOpen:
windAlgorithm.ipynb
uv run pytestThe test suite covers:
- budget parsing and currency conversion;
- blocked social sources;
- source verification ranking;
- combined budget allocation;
- protection against bad web lookup replacing good declared budgets;
- validated-reference budget estimation;
- outlier classification;
- classifier CLI smoke test.
See:
METHODOLOGY.md
It documents data sources, budget normalization, source verification, combined-budget handling, CAPEX/OPEX/LCOE formulas, ML validation, confidence scoring, and limitations.
The cleaned dataset currently contains:
182 projects
127 A/B verified projects usable for LCOE and ML
The project is suitable as a strong educational decision-support prototype. It is not a bankable investment model; project-level financial decisions still require source-by-source manual review.