This project aims to predict battery life for various electronic devices using machine learning techniques. The dataset is preprocessed to extract key features, and multiple regression models are trained to estimate battery life accurately. The project includes single-model training and pairwise ensemble model training for better predictive performance.
device_battery_data.xlsx: Dataset containing battery performance metrics for different devices.Single_Models.py: Script to train and evaluate individual machine learning models.Pair_Models.py: Script to train and evaluate ensemble models using pairwise stacking regressors.
The dataset includes features such as:
- Battery Capacity (mAh) and Battery Voltage (V) to calculate total battery energy.
- Charging Cycles, Device Age, and Battery Lifespan to compute battery degradation.
- Operating Temperature and Environmental Conditions to adjust for external factors.
- Power Consumption in Active and Sleep Modes to estimate daily energy usage.
Feature engineering steps include:
- Computing
Battery_Degradation_Factorusing charging cycles and device age. - Calculating
Average_Power_Consumptionbased on usage patterns. - Scaling features using
StandardScaler. - Handling missing values and removing outliers using IQR filtering.
The following models are trained and evaluated using cross-validation:
- Linear Regression, Lasso, Ridge, ElasticNet
- Decision Tree, Random Forest, Gradient Boosting, XGBoost
- Support Vector Regression, K-Nearest Neighbors
- AdaBoost, Bagging, Extra Trees
Some models are fine-tuned using RandomizedSearchCV for hyperparameter optimization.
- Pairs of models are combined using
StackingRegressorto improve performance. - Ridge Regression is used as the final estimator.
- Each model pair is evaluated on MSE, MAE, and R² scores.
Ensure you have the required dependencies installed:
pip install numpy pandas scikit-learn xgboost joblib openpyxlTo run single-model training:
python Single_Models.pyTo run pairwise model training:
python Pair_Models.pyModels are evaluated using:
- Mean Squared Error (MSE): Measures prediction error.
- Mean Absolute Error (MAE): Measures average absolute error.
- R² Score: Measures the proportion of variance explained by the model.
- Implement deep learning models using TensorFlow/PyTorch.
- Experiment with Quantum Neural Networks (QNN) using Qiskit.
- Incorporate real-time battery performance monitoring.