This project implements a machine learning pipeline for predicting battery capacity using various input parameters. The system includes data processing, model training, and a Flask web interface for making real-time predictions.
- End-to-end ML pipeline for battery capacity prediction
- Real-time prediction API using Flask
- Comprehensive data validation and transformation
- MLflow integration for experiment tracking
- DagsHub integration for model registry
- Modular and maintainable code structure
- Logging and error handling
Battery_Capacity_Prediction/
├── README.md
├── setup.py
├── src/
│ ├── __init__.py
│ ├── components/
│ │ ├── __init__.py
│ │ ├── data_ingestion.py
│ │ ├── data_transformation.py
│ │ ├── data_validation.py
│ │ ├── model_evaluation.py
│ │ └── model_trainer.py
│ ├── config/
│ │ ├── __init__.py
│ │ └── configuration.py
│ ├── constants/
│ │ └── __init__.py
│ ├── entity/
│ │ ├── __init__.py
│ │ └── config_entity.py
│ ├── pipeline/
│ │ ├── __init__.py
│ │ ├── data_ingestion_pipeline.py
│ │ ├── data_transformation_pipeline.py
│ │ ├── data_validation_pipeline.py
│ │ ├── model_evaluation_pipeline.py
│ │ ├── model_training_pipeline.py
│ │ └── prediction_pipeline.py
│ └── utils/
│ ├── __init__.py
│ └── common.py
└── tests/
└── test_pipeline.py
- Python 3.8 or higher
- pip package manager
- Clone the repository:
git clone https://github.com/yourusername/Battery_Capacity_Prediction.git
cd Battery_Capacity_Prediction
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the package in development mode:
pip install -e .
This will install the package Battery_Capacity_Prediction_System
and all its dependencies.
The project uses a modular configuration system:
src/config/configuration.py
: Main configuration managementsrc/entity/config_entity.py
: Configuration entities and data structuressrc/constants/__init__.py
: Global constants and configurations
To execute the complete training pipeline:
python main.py
This will run the following stages:
- Data Ingestion
- Data Validation
- Data Transformation
- Model Training
- Model Evaluation
data_ingestion.py
: Handles data loading and initial processingdata_validation.py
: Validates data quality and schemadata_transformation.py
: Performs feature engineering and preprocessingmodel_trainer.py
: Implements model training logicmodel_evaluation.py
: Evaluates model performance using MLflow
To start the prediction service:
python app.py
The application will be available at http://localhost:8080
GET /
: Home page with prediction formPOST /predict
: Make predictionsPOST /train
: Retrigger model training
This project uses MLflow for experiment tracking and DagsHub for model registry. Configure your MLflow tracking URI and DagsHub credentials in the configuration files.
The model accepts the following features for prediction:
- Battery Type
- Start Time
- Ambient Temperature
- Battery ID
- Test ID
- UID
- Filename
- Re (Resistance)
- Rct (Charge Transfer Resistance)
Run the tests using:
python -m pytest tests/
To modify or extend the pipeline:
- Update configuration in
src/config/configuration.py
- Define new entities in `src/
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
For questions or collaboration opportunities: