{"id":26451046,"url":"https://github.com/muhkartal/e-forecast","last_synced_at":"2026-04-08T21:32:14.480Z","repository":{"id":282122449,"uuid":"947562171","full_name":"muhkartal/e-forecast","owner":"muhkartal","description":"machine learning-powered energy consumption prediction system that analyzes historical data to forecast future energy usage trends, optimizing efficiency and sustainability.","archived":false,"fork":false,"pushed_at":"2025-03-22T14:57:27.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T15:35:03.942Z","etag":null,"topics":["fastapi","joblib","matplotlib","numpy","pandas","pydantic","pytest","sckit-learn","seaborn","tensorflow","tqdm","uvicorn","xgboost","yaml"],"latest_commit_sha":null,"homepage":"https://kartal.dev/","language":"Python","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/muhkartal.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}},"created_at":"2025-03-12T22:18:13.000Z","updated_at":"2025-03-22T14:57:30.000Z","dependencies_parsed_at":"2025-03-12T23:25:00.817Z","dependency_job_id":null,"html_url":"https://github.com/muhkartal/e-forecast","commit_stats":null,"previous_names":["muhkartal/energyconsumption_prediction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muhkartal/e-forecast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhkartal%2Fe-forecast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhkartal%2Fe-forecast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhkartal%2Fe-forecast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhkartal%2Fe-forecast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhkartal","download_url":"https://codeload.github.com/muhkartal/e-forecast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhkartal%2Fe-forecast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31575528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fastapi","joblib","matplotlib","numpy","pandas","pydantic","pytest","sckit-learn","seaborn","tensorflow","tqdm","uvicorn","xgboost","yaml"],"created_at":"2025-03-18T16:31:24.525Z","updated_at":"2026-04-08T21:32:14.470Z","avatar_url":"https://github.com/muhkartal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EV Energy Prediction System\n\n\u003cdiv align=\"center\"\u003e\n\n![EV Energy Prediction](images/main.png)\n\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue)](https://www.python.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Docker](https://img.shields.io/badge/Docker-Supported-2496ED?logo=docker)](docker-compose.yml)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n\n**Advanced machine learning system for accurately predicting energy consumption in electric vehicles**\n\n[Features](#features) | [Installation](#installation) | [Quick Start](#quick-start) | [Documentation](#documentation) | [Contributing](#contributing)\n\n\u003c/div\u003e\n\n## Overview\n\nThe EV Energy Prediction System is a sophisticated machine learning solution that addresses the critical challenge of accurately predicting energy consumption in electric vehicles. By leveraging state-of-the-art ensemble models and comprehensive feature engineering, the system provides highly reliable energy usage forecasts and range estimations based on diverse factors including driving conditions, weather patterns, route characteristics, and vehicle-specific parameters.\n\nDeveloped for production deployment, this system helps EV users, fleet operators, and vehicle manufacturers overcome range anxiety through precise predictions that optimize route planning, charging strategies, and overall energy management. The architecture follows MLOps best practices with modular components, ensuring scalability, maintainability, and continuous improvement.\n\n## Features\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cb\u003e🔮 Precise Prediction Engine\u003c/b\u003e\u003cbr\u003e\n      Accurate energy consumption forecasting leveraging ensemble machine learning models that adapt to diverse driving scenarios\n    \u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cb\u003e🌐 Comprehensive Factor Analysis\u003c/b\u003e\u003cbr\u003e\n      Integration of multiple data dimensions including route topology, weather conditions, vehicle specifications, and driving patterns\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cb\u003e⚙️ Advanced Model Architecture\u003c/b\u003e\u003cbr\u003e\n      Combination of LSTM networks for temporal patterns and XGBoost for complex feature interactions, optimized for accuracy\n    \u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cb\u003e🔌 Production-Ready API\u003c/b\u003e\u003cbr\u003e\n      Robust RESTful API designed for seamless integration with vehicle systems, navigation apps, and fleet management platforms\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cb\u003e📊 Interactive Visualization\u003c/b\u003e\u003cbr\u003e\n      Comprehensive dashboards and reporting tools for analyzing energy consumption patterns and optimization opportunities\n    \u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\n      \u003cb\u003e🛠️ Extensible Framework\u003c/b\u003e\u003cbr\u003e\n      Modular architecture enabling easy addition of new features, model improvements, and integration capabilities\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n### Key Components\n\n- **Data Pipeline**: Processes diverse data sources including route information, weather data, and vehicle telemetry\n- **Feature Engineering**: Transforms raw data into meaningful features through domain-specific algorithms\n- **Model Training**: Implements a systematic approach to model development with validation and hyperparameter optimization\n- **Ensemble Model**: Combines multiple algorithms to balance the strengths of different prediction approaches\n- **Prediction API**: Provides a robust interface for real-time predictions with appropriate error handling\n- **Evaluation \u0026 Monitoring**: Ensures continuous model quality through automated testing and performance tracking\n\n## Project Structure\n\n```\n├── config/                  # Configuration management\n│   └── model_config.yaml    # Model hyperparameters and settings\n├── data/                    # Data management\n│   └── preprocess.py        # Data preprocessing utilities\n├── images/                  # Project images and diagrams\n├── models/                  # Model implementations\n│   ├── ensemble.py          # Ensemble model architecture\n│   ├── lstm_model.py        # LSTM implementation for temporal data\n│   ├── train_model.py       # Model training orchestration\n│   └── xgboost_model.py     # XGBoost implementation\n├── scripts/                 # Utility scripts\n│   ├── deploy.sh            # Deployment automation\n│   └── train.sh             # Training execution\n├── src/                     # Core source code\n│   ├── api/                 # API implementation\n│   │   ├── main.py          # API entry point\n│   │   ├── prediction.py    # Prediction service\n│   │   └── schemas.py       # API request/response schemas\n│   ├── features/            # Feature engineering\n│   │   └── build_features.py # Feature generation and transformation\n│   └── visualization/       # Visualization components\n│       └── visualize.py     # Visualization utilities\n├── test/                    # Comprehensive test suite\n│   ├── conftest.py          # Test configurations\n│   ├── test_api.py          # API tests\n│   └── test_models.py       # Model tests\n├── .gitattributes           # Git attributes\n├── .gitignore               # Git ignore rules\n├── docker-compose.yml       # Docker Compose configuration\n├── Dockerfile               # Docker configuration\n├── LICENSE                  # License information\n├── README.md                # Project documentation\n└── requirements.txt         # Dependency management\n```\n\n## Quick Start\n\nGet up and running with the EV Energy Prediction System in minutes:\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/ev-energy-prediction.git\ncd ev-energy-prediction\n\n# Set up with Docker (recommended for quick start)\ndocker-compose up -d\n\n# Access the API documentation\nopen http://localhost:8000/docs\n```\n\n## Installation\n\n### Prerequisites\n\n- Python 3.8+\n- Docker and Docker Compose (for containerized deployment)\n- NVIDIA GPU (recommended for model training)\n\n### Standard Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/ev-energy-prediction.git\ncd ev-energy-prediction\n\n# Create and activate virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install dependencies\npip install -r requirements.txt\n\n# Verify installation\npython -c \"from src.api.prediction import predict_energy_consumption; print('Installation successful')\"\n```\n\n### Docker Installation\n\nFor containerized deployment with all dependencies preconfigured:\n\n```bash\n# Build and start services\ndocker-compose up -d\n\n# Verify services are running\ndocker-compose ps\n```\n\n## Documentation\n\n### API Usage\n\nThe system provides a RESTful API for energy consumption predictions:\n\n```python\nimport requests\nimport json\n\n# API endpoint\nurl = \"http://localhost:8000/api/v1/predict\"\n\n# Example request data\npayload = {\n    \"route\": {\n        \"origin\": {\"lat\": 37.7749, \"lng\": -122.4194},\n        \"destination\": {\"lat\": 37.3352, \"lng\": -121.8811},\n        \"departure_time\": \"2023-05-10T08:00:00Z\"\n    },\n    \"vehicle\": {\n        \"model\": \"Model Y\",\n        \"year\": 2023,\n        \"battery_capacity\": 75.0,\n        \"efficiency\": 0.16\n    },\n    \"weather\": {\n        \"temperature\": 18.5,\n        \"precipitation\": 0,\n        \"wind_speed\": 10\n    }\n}\n\n# Make prediction request\nresponse = requests.post(url, json=payload)\nresult = response.json()\n\nprint(f\"Estimated energy consumption: {result['prediction']['energy_kwh']} kWh\")\nprint(f\"Estimated range: {result['prediction']['range_km']} km\")\n```\n\n### API Reference\n\n#### Prediction Endpoint\n\n`POST /api/v1/predict`\n\n**Request Schema:**\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `route` | Object | Route information including origin, destination, and optional waypoints |\n| `vehicle` | Object | Vehicle specifications including model, battery capacity, and efficiency |\n| `weather` | Object | Weather conditions including temperature, precipitation, and wind |\n| `options` | Object | Optional settings for the prediction request |\n\n**Response Schema:**\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `prediction` | Object | Prediction results including energy consumption and range |\n| `route_details` | Object | Analyzed route information |\n| `metadata` | Object | Information about the prediction process |\n\nFor complete API documentation, visit the Swagger UI at `/docs` when the server is running.\n\n### Training Models\n\nThe system provides tools for training and optimizing prediction models:\n\n```bash\n# Run standard training process\n./scripts/train.sh\n\n# Run training with custom configuration\npython models/train_model.py --config custom_config.yaml --output_dir models/checkpoints\n```\n\n## Development\n\n### Development Environment\n\n```bash\n# Install development dependencies\npip install -r requirements-dev.txt\n\n# Set up pre-commit hooks\npre-commit install\n\n# Run code formatter\nblack .\n```\n\n### Code Style\n\nThis project follows strict coding standards:\n\n- [PEP 8](https://www.python.org/dev/peps/pep-0008/) guidelines for Python code\n- Black for consistent code formatting\n- Type hints for improved code quality and IDE support\n\n```bash\n# Verify code style\nflake8 .\n\n# Apply automatic formatting\nblack .\n\n# Check type hints\nmypy src\n```\n\n### Testing\n\nThe project includes comprehensive tests to ensure code quality:\n\n```bash\n# Run all tests\npytest\n\n# Run tests with coverage report\npytest --cov=src --cov=models\n\n# Run specific test modules\npytest test/test_models.py\n```\n\n## Deployment\n\n### Docker Deployment\n\nThe recommended deployment method uses Docker:\n\n```bash\n# Deploy with Docker Compose\ndocker-compose -f docker-compose.prod.yml up -d\n\n# Scale the prediction service\ndocker-compose -f docker-compose.prod.yml up -d --scale prediction=3\n```\n\n### Manual Deployment\n\nFor environments without Docker:\n\n```bash\n# Install production dependencies\npip install -r requirements.txt\n\n# Start the API server\ngunicorn -w 4 -k uvicorn.workers.UvicornWorker src.api.main:app\n```\n\n## Performance\n\nThe EV Energy Prediction System delivers reliable performance metrics:\n\n| Metric | Value | Description |\n|--------|-------|-------------|\n| Prediction Accuracy | ~92-95% | Energy consumption prediction accuracy under varied conditions |\n| API Latency | \u003c100ms | Average response time for prediction requests |\n| Throughput | 100+ req/s | Requests handled per second per instance |\n| GPU Training Time | ~2 hours | Complete model training cycle on recommended hardware |\n\n## Contributing\n\nWe welcome contributions to the EV Energy Prediction System! Please follow these steps:\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Run tests to ensure everything works (`pytest`)\n4. Commit your changes (`git commit -m 'Add some amazing feature'`)\n5. Push to the branch (`git push origin feature/amazing-feature`)\n6. Open a Pull Request\n\nFor detailed contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n### Areas for Contribution\n\n- Enhanced prediction models\n- Additional feature engineering approaches\n- Improved visualization tools\n- Extended API capabilities\n- Performance optimizations\n- Documentation improvements\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE) - see the LICENSE file for details.\n\n## Acknowledgements\n\n- Open-source libraries that power this project:\n  - [TensorFlow](https://www.tensorflow.org/) for deep learning capabilities\n  - [XGBoost](https://xgboost.readthedocs.io/) for gradient boosting implementation\n  - [FastAPI](https://fastapi.tiangolo.com/) for API development\n  - [Pandas](https://pandas.pydata.org/) and [NumPy](https://numpy.org/) for data processing\n  - [Docker](https://www.docker.com/) for containerization\n\n\n---\n\u003c!-- \n## Contact\n\n-  Project Link: [https://github.com/yourusername/FR-Framework](https://github.com/muhkartal/FR-Framework)\n-  Developer Website: [https://kartal.dev/](https://kartal.dev/) --\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n\u003cp\u003eIf you find E-Forecast helpful, please consider giving it a star ⭐\u003c/p\u003e\n\u003cp\u003e@Muhkartal - kartal.dev\u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhkartal%2Fe-forecast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhkartal%2Fe-forecast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhkartal%2Fe-forecast/lists"}