This project involves building a Machine Learning (ML) model to predict solar energy consumption based on historical energy usage data. The dataset contains information about different Indian states, energy generation, consumption, surplus energy, and battery storage levels.
- solar_energy_usage_india.csv → Dataset containing 500 records of solar energy usage, including weekdays, holidays, and energy consumption details.
- solar_energy_usage_india.py → Python script for data preprocessing, cleaning, and model training.
- README.txt → This document describing the project.
To run this project, install the following Python libraries:
pip install pandas numpy seaborn scikit-learn matplotlib- Load the dataset:
solar_energy_usage_india_weekend_holidays.csv. - Preprocess the data:
- Handle missing values.
- Convert categorical variables (state, day of the week, holiday) into numerical form using Label Encoding.
- Drop unnecessary columns like
Date.
- Visualize the data: Plot energy consumption distribution.
- Split the dataset: 80% for training, 20% for testing.
- Standardize features: Normalize input features for better model performance.
- Train a Linear Regression Model to predict energy consumption.
- Evaluate Model Performance using metrics:
- Mean Absolute Error (MAE)
- Mean Squared Error (MSE)
- R-squared Score (R²)
After training, you can predict energy consumption using:
model.predict([[5,3,1,28,15.69,3.25]])- The model predicts Energy Consumed (kWh) based on other variables.
- It helps in optimizing solar energy usage by identifying consumption trends.
- Try different ML models like Random Forest or XGBoost.
- Add weather conditions (sunlight hours, temperature) as additional features.
- Improve feature engineering for better accuracy.