This project aims to develop a robust machine learning model to predict the solar power output of panels in Egypt, taking into account recent climate changes and their impact on weather conditions.
# Solar Panel Power Output Prediction in Egypt
This project aims to develop a robust machine learning model to predict the solar power output of panels in Egypt, taking into account recent climate changes and their impact on weather conditions.
## Problem Statement
Solar energy production in Egypt is influenced by changing weather patterns, especially due to climate change. Existing models often fail to reflect these recent shifts. This project builds a model that:
* Predicts daily solar panel power output.
* Incorporates multiple weather parameters.
* Compares different regression algorithms for optimal accuracy.
## Dataset
* **Source:** Weather data collected from Aswan, Egypt.
* **Records:** 398 daily observations.
* **Features:**
* `Date`
* `AvgTemp` (Fahrenheit)
* `AverageDew`
* `Humidity`
* `Wind`
* `Pressure`
* `Solar(PV)` – Target variable (power output in watts)
## Data Preprocessing
### Steps Taken:
1. **Date Parsing:** Converted `Date` from object to datetime.
2. **Missing Values:** Linear interpolation applied to missing `AvgTemp`.
3. **Outlier Removal:**
* Used **IQR** and **MAD** techniques.
* Replaced negative solar values with mean.
4. **Feature Scaling:** Used `StandardScaler` for normalization.
## Exploratory Data Analysis
* **Correlation Matrix:** Identified strong positive correlations between `Solar(PV)` and:
* `Humidity` (0.72)
* `AverageDew` (0.66)
* `Wind` (0.34)
* **Distributions & Outliers:** Visualized via histograms and boxplots.
* **Temporal Trends:** Time series plots revealed seasonal and daily patterns.
## Feature Selection
Used **Pearson's Correlation** to select features most correlated with solar output:
* Included: `Humidity`, `AverageDew`, `Wind`
* Excluded: `Pressure`, `AvgTemp` (weak/negative correlations)
## Models Evaluated
| Model Type | MAE | RMSE | R² | Adj. R² | Accuracy |
| ------------------------- | ---- | ---- | -------- | -------- | -------- |
| Linear Regression (No FS) | 0.3 …