{"id":26779103,"url":"https://github.com/carlosyazid/energy-uk","last_synced_at":"2026-04-13T12:01:49.206Z","repository":{"id":285037220,"uuid":"956879902","full_name":"CarlosYazid/Energy-UK","owner":"CarlosYazid","description":"Time series models for forecasting solar energy consumption and generation in the United Kingdom.","archived":false,"fork":false,"pushed_at":"2025-03-29T05:41:42.000Z","size":6775,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T08:06:21.083Z","etag":null,"topics":["azure","mlflow","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CarlosYazid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-29T03:20:12.000Z","updated_at":"2025-03-29T19:53:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"2189d2b6-f11d-4d19-9aff-42a761ff9df4","html_url":"https://github.com/CarlosYazid/Energy-UK","commit_stats":null,"previous_names":["carlosyazid/energy-uk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CarlosYazid/Energy-UK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarlosYazid%2FEnergy-UK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarlosYazid%2FEnergy-UK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarlosYazid%2FEnergy-UK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarlosYazid%2FEnergy-UK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarlosYazid","download_url":"https://codeload.github.com/CarlosYazid/Energy-UK/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarlosYazid%2FEnergy-UK/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278283455,"owners_count":25961311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","mlflow","tensorflow"],"created_at":"2025-03-29T06:14:48.198Z","updated_at":"2025-10-04T07:53:14.852Z","avatar_url":"https://github.com/CarlosYazid.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Energy-UK: Solar Energy Forecasting Models\n\n![Energy Forecast](https://img.shields.io/badge/Python-3.10%2B-blue)\n![ML Framework](https://img.shields.io/badge/TensorFlow-2.17.1-orange)\n![Deployment](https://img.shields.io/badge/AzureML-Compatible-green)\n\n## 1. Project Name\n**Energy-UK** - Time Series Models for Solar Energy Consumption and Generation Forecasting in the United Kingdom\n\n## 2. Brief Description\nEnergy-UK is a comprehensive machine learning project that provides accurate forecasts of solar energy consumption and generation across the United Kingdom. The system utilizes advanced time series models (LSTM and GRU networks) trained on historical energy data and weather patterns to predict:\n- National electricity demand (`nd`)\n- Solar energy generation (`solarenergy`)\n\nThe project includes complete ML pipelines from data preparation to model deployment on Azure ML, with integrated monitoring through MLflow.\n\n## 3. Main Features\n\n### Core Capabilities\n- **Dual Forecasting Models**:\n  - LSTM network for energy consumption prediction\n  - GRU network for solar generation forecasting\n- **Multi-modal Data Integration**:\n  - Energy grid operational data\n  - Meteorological measurements (solar radiation, cloud cover, etc.)\n- **Production-Ready Infrastructure**:\n  - MLflow experiment tracking\n  - Azure ML deployment pipelines\n  - Scalable inference endpoints\n\n### Technical Highlights\n- Automated feature engineering pipelines\n- Dynamic windowing for time series data\n- Hyperparameter tracking with MLflow\n- Model versioning and registry\n- CI/CD-ready deployment scripts\n\n## 4. Prerequisites\n\n### Hardware Requirements\n- GPU-enabled system recommended (CUDA 12.x compatible)\n- Minimum 16GB RAM\n- 10GB free disk space\n\n### Software Dependencies\n```plaintext\nPython 3.10+\nTensorFlow 2.17.1\nAzure ML SDK\nMLflow 2.11.3\n```\n\nComplete dependency list available in:\n- `requirements.txt` (1,200+ packages)\n- Conda environment specifications\n\n### Data Requirements\n- UK National Grid historical data (provided in `uk_electricity.csv`)\n- Meteorological records (provided in `uk_weather.csv`)\n\n## 5. Installation\n\n### Local Development Setup\n1. Clone repository:\n   ```bash\n   git clone https://github.com/CarlosYazid/Energy-UK.git\n   cd Energy-UK\n   ```\n\n2. Create Conda environment:\n   ```bash\n   conda env create -f environment.yml\n   conda activate uk-energy-env\n   ```\n\n3. Install remaining dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n### Azure ML Workspace Configuration\n1. Set environment variables:\n   ```bash\n   export AZURE_SUBSCRIPTION_ID=\u003cyour-subscription-id\u003e\n   export AZURE_RESOURCE_GROUP=\u003cyour-resource-group\u003e\n   export AZURE_WORKSPACE_NAME=\u003cworkspace-name\u003e\n   ```\n\n2. Authenticate using Azure CLI:\n   ```bash\n   az login\n   az account set --subscription $AZURE_SUBSCRIPTION_ID\n   ```\n\n## 6. Usage\n\n### Model Training\n**Energy Consumption Model**:\n```bash\njupyter nbconvert --to python \"Training-Energy-Comsumption.ipynb\" \u0026\u0026 python Training-Energy-Comsumption.py\n```\n\n**Solar Generation Model**:\n```bash\njupyter nbconvert --to python \"Training-Generation-Energy.ipynb\" \u0026\u0026 python Training-Generation-Energy.py\n```\n\n### Deployment\n1. Configure deployment settings in `Deploy.py`:\n   ```python\n   model_deployment = ManagedOnlineDeployment(\n       name=\"UKEnergyModelDeploy\",\n       endpoint_name=\"uk-energy-model-endpoint\",\n       instance_type=\"Standard_DS4_v2\",\n       instance_count=1\n   )\n   ```\n\n2. Execute deployment:\n   ```bash\n   jupyter nbconvert --to python \"Deploy.ipynb\" \u0026\u0026 python Deploy.py\n   ```\n\n### Inference\nSample request to deployed endpoint:\n```python\nimport requests\n\nendpoint = \"https://uk-energy-model-endpoint.azureml.net/score\"\ndata = {\"input_data\": [...]}  # Your time series window\n\nresponse = requests.post(endpoint, json=data, headers={\"Authorization\": \"Bearer API_KEY\"})\nprint(response.json())\n```\n\n## 7. Examples\n\n### Example 1: Training Validation\n![Training Validation](/training_validation_loss.png)\n\n### Example 2: Sample Prediction\n```python\n# Load saved model\nmodel = mlflow.keras.load_model(\"models/tensorflow_series_UK_energy_v2\")\n\n# Make prediction\nforecast = model.predict(X_test)\n```\n\n### Example 3: Batch Processing\n```python\nfrom scripts.inference_score import run\n\nwith open(\"batch_data.json\") as f:\n    results = run(f.read())\n```\n\n## 8. Project Structure\n\n```\nEnergy-UK/\n├── .gitignore\n├── requirements.txt            # Full Python dependencies\n├── scripts/\n│   └── inference_score.py      # Scoring script for deployment\n├── Deploy.ipynb                  # Azure ML deployment configuration\n├── Training-Energy-Comsumption.ipynb  # LSTM model for energy demand\n├── Training-Generation-Energy.ipynb   # GRU model for solar generation\n├── uk_electricity.csv      # Grid operational data\n├── uk_weather.csv          # Meteorological records\n├── training_validation_loss.png   # Image of training validation\n└── environment.yml             # Conda environment spec\n```\n\n## 9. API Reference\n\n### Inference Endpoint\n**POST /score**\n- Input: JSON array of time series windows\n- Output: Predicted values with confidence intervals\n\n### Model Signatures\n**Consumption Model**:\n```python\nModelSignature(\n    inputs=Schema([\n        TensorSpec(np.int16, (-1,), \"settlement_period\"),\n        TensorSpec(np.float16, (-1,), \"period_hour\"),\n        # ... additional features\n    ]),\n    outputs=Schema([\n        TensorSpec(np.float32, (-1,), \"nd\")\n    ])\n)\n```\n\n## 10. How to Contribute\n\n### Contribution Workflow\n1. Fork the repository\n2. Create feature branch (`git checkout -b feature/your-feature`)\n3. Commit changes (`git commit -m 'Add some feature'`)\n4. Push to branch (`git push origin feature/your-feature`)\n5. Open Pull Request\n\n### Coding Standards\n- PEP 8 compliance\n- Type hints for all functions\n- MLflow experiment tracking for all model changes\n\n## 11. Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| CUDA errors | Verify CUDA 12.x and cuDNN compatibility |\n| Azure auth failures | Run `az login` and check subscription |\n| Shape mismatches | Validate window_size parameter matches training |\n\n## 12. Changelog\n\n### [1.0.0] - 2025-03-29\n- Initial release with LSTM and GRU models\n- Azure ML deployment pipelines\n- MLflow experiment tracking\n\n## 13. License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 14. Contact\n**Project Maintainer**: Carlos Yazid \u003cbr\u003e\n**Email**: contact@carlospadilla.co  \n**Issue Tracking**: [Issues](https://github.com/CarlosYazid/Energy-UK/issues)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosyazid%2Fenergy-uk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlosyazid%2Fenergy-uk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosyazid%2Fenergy-uk/lists"}