Skip to content

A repository focused on predicting solar panel power output using machine learning techniques. The project features data preprocessing, model training with TensorFlow/Keras, visualization of data relationships, and comprehensive model evaluation. It includes scripts for easy setup, running predictions, and unit tests to ensure code reliability.

Notifications You must be signed in to change notification settings

bharatbhusal/solar_panel_power_prediction_and_visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solar Panel Power Prediction and Visualization

Welcome to the Solar Panel Power Prediction and Visualization project repository! This project focuses on predicting the power output of solar panels based on module temperature data using machine learning techniques. Here's a detailed guide on setting up the environment, running the project, visualizing data, evaluating the model, and testing the project.

Overview

The project includes data preprocessing, model training using TensorFlow/Keras, evaluation using metrics like accuracy and a confusion matrix, and visualization of various aspects of the dataset.

Project Structure

  • data/dataset.csv: Dataset containing solar panel data including module temperature and DC power.
  • src/: Independent Scripts to perform specific operations.
  • main.py: Python script for data preprocessing, model creation, training, prediction and visualization.
  • README.md: This file, providing an overview of the project, setup instructions, and usage details.
  • requirements.txt: Python dependencies required to run the project.
  • .gitignore: Specifies files and directories that should be ignored by Git.
  • tests/: Directory containing unit tests for the project modules.

Setting Up Your Environment

Prerequisites

Ensure you have Python 3.6 or higher installed on your system along with the Pip package manager.

Setting up the codebase

Using a virtual environment is recommended to manage dependencies and avoid conflicts with other projects. Follow these steps:

  1. Clone the Repository:

    git clone https://github.com/bharatbhusal/solar_panel_power_prediction_and_visualization.git
    cd solar_panel_power_prediction_and_visualization
  2. Create the Virtual Environment:

    python -m venv venv

    This command creates a virtual environment named venv in the current directory.

  3. Activate the Virtual Environment:

    • On Windows:

      venv\Scripts\activate
    • On macOS and Linux:

      source venv/bin/activate

    When the virtual environment is activated, your command prompt will change to show the name of the virtual environment, typically something like (venv) before the prompt.

  4. Install Dependencies:

    With the virtual environment activated, install the required Python packages using pip:

    pip install -r requirements.txt

    This will install TensorFlow, pandas, matplotlib, and scikit-learn, along with other necessary dependencies.

  5. Run Your Script:

    Execute your Python script while the virtual environment is active:

    python main.py
  6. Deactivate the Virtual Environment:

    After you're done working in the virtual environment, deactivate it:

    deactivate

    This command deactivates the virtual environment and returns you to the system's default Python interpreter.

Running the Project

  1. Prepare the Dataset:

    Ensure that dataset.csv is in the project directory. This file contains the solar panel data needed for training and predictions.

  2. Execute the Script:

    Run the prediction script to start the process:

    python main.py
  3. Input Temperature Values:

    Follow the prompts in the script to input temperature values. The model will use these inputs to predict the corresponding power output.

Data Visualization

Explore various plots generated using matplotlib in the main.py script to visualize different aspects of the dataset:

  • Time vs. Temperature
  • Histogram of Temperature
  • Line Plot (Date Time vs. Temperature)
  • Temperature vs. DC Power
  • Line Plot (Temperature vs. DC Power)
  • Scatter Plot (Temperature vs. DC Power)
  • Histogram of DC Power

Model Evaluation

The model's performance is evaluated using metrics such as accuracy and a confusion matrix, providing insights into its effectiveness.

Testing the Project

To ensure that the code is functioning as expected, you can run unit tests. These tests validate the functionality of various components of the project.

  1. Navigate to the Tests Directory:

    cd tests
  2. Run the Tests:

    Use the unittest framework to execute the test cases:

    python -m unittest discover

    This command will automatically discover and run all test cases in the tests directory.

Future Improvements

  • Explore more complex neural network architectures.
  • Enhance data preprocessing techniques.
  • Deploy the model as a service for real-time predictions.

Contributing

Contributions to the project are welcome! If you have suggestions for improvements or find issues, please open an issue or submit a pull request on GitHub.

About

A repository focused on predicting solar panel power output using machine learning techniques. The project features data preprocessing, model training with TensorFlow/Keras, visualization of data relationships, and comprehensive model evaluation. It includes scripts for easy setup, running predictions, and unit tests to ensure code reliability.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages