A comprehensive Machine Learning project to forecast Solar Photovoltaic (PV) power generation featuring a custom From-Scratch Decision Tree algorithm.
Accurate solar PV forecasting is critical for grid stability and efficient energy management. This project applies machine learning techniques to predict PV power output based on weather data and other environmental factors.
A major highlight of this project is a from-scratch implementation of a Decision Tree (Regressor and Classifier), which is then rigorously benchmarked against industry-standard models.
- Custom Decision Tree Implementation: A purely from-scratch Decision Tree supporting MSE splitting (regression) and Gini/Entropy splitting (classification), built without using
sklearn.tree. - Extensive Benchmarking: Evaluates and compares 9 Regression models and 9 Classification models.
- Comprehensive Metrics: Assesses model performance across 55+ different evaluation metrics (including MAE, MSE, R², F1, ROC-AUC, etc.).
- Rich Visualizations: Generates 20 high-resolution plots organized into 6 multi-panel figures, visualizing dataset distributions, weather correlations, residual scatters, ROC curves, and more.
- Automated Presentation Generation: Python scripts included to programmatically compile results into a structured PowerPoint presentation.
ML_project/
├── data/ # Datasets and generated metrics
│ ├── LBNL_file.csv # Large dataset (Ignored by Git to fit limits)
│ ├── classification_metrics.csv
│ ├── regression_metrics.csv
│ └── solar_pv_full_results.csv
├── docs/ # Research papers and generated presentations
│ ├── Solar_PV_Forecasting.pptx
│ └── ML project sample PPT.pdf
├── figures/ # High-resolution output plots (.png)
│ ├── fig1_dataset_exploration.png
│ ├── fig2_solar_weather.png
│ └── ...
└── src/ # Python source code
├── solar_pv_forecasting_v2.py # Core ML logic and custom Decision Tree
├── solar_pv_plots.py # Visualization suite
└── create_solar_pv_ppt.py # Script to generate PPT reports
Regression: Linear Regression, Ridge, Lasso, Random Forest, Gradient Boosting, Extra Trees, Support Vector Regressor (SVR), K-Nearest Neighbors (KNN), and our Custom Decision Tree Regressor.
Classification: Logistic Regression, Random Forest, Gradient Boosting, AdaBoost, Extra Trees, SVC, KNN, Gaussian Naive Bayes, and our Custom Decision Tree Classifier.
- Ensure you have Python 3.x installed along with the required libraries:
numpy,pandas,scikit-learn,matplotlib,seaborn,python-pptx(for presentation generation). - Place the dataset inside the
data/directory. - Run
src/solar_pv_forecasting_v2.pyto train models and generate_metrics.csvfiles. - Run
src/solar_pv_plots.pyto generate the evaluation figures. - Run
src/create_solar_pv_ppt.pyto automatically compile the insights into a.pptxfile.