FWI predictor web application predicts the Fire Weather Index (FWI) for Algerian forest fires using various regression models, including Ridge Regression, Lasso Regression, Linear Regression, and ElasticNet. The model selection process involved thorough comparison and cross-validation, ultimately determining Ridge Regression as the optimal choice due to its superior accuracy.
The model is trained on a dataset encompassing two regions of Algeria—Bejaia in the northeast and Sidi Bel-abbes in the northwest. The dataset spans from June to September 2012 and includes various weather-related attributes such as temperature, relative humidity, wind speed, rain, and components of the FWI system.
The detailed analysis and code implementation are available in the Jupyter notebook.
FWI_Predict.mp4
- Instances: 244 (122 for each region)
- Attributes: 11 weather-related attributes and 1 output attribute (FWI)
- Programming Language: Python
- Libraries: Pandas, NumPy, Seaborn, Matplotlib, Scikit-learn , Pickle, Warnings
- Web Framework: Flask
- Frontend: HTML, CSS
- Deployment: AWS Elastic Beanstalk, AWS CodePipeline
The dataset underwent rigorous cleaning, addressing missing values, mispaced entries, and data type conversions. Regions were added as a new column, and unnecessary features were dropped. Categorical values were cleaned, and the dataset was saved as a cleaned CSV file.
EDA was performed to analyze the distribution of fires across different months and regions. August emerged as the month with the highest number of fires in both regions. Visualization tools like box plots, count plots, and correlation matrices were employed to derive insights.
Feature selection based on correlation was conducted to identify highly correlated features, and multicollinearity was addressed by dropping correlated columns. The data was split into training and testing sets, and features were standardized using StandardScaler. Various regression models, including Ridge, Lasso, Linear Regression, and ElasticNet, were compared, and Ridge Regression was selected based on superior accuracy and generalization.
The model's performance was evaluated using metrics such as Mean Absolute Error (MAE) and R2 Score. The Ridge Regression model exhibited promising results, providing valuable insights into FWI prediction for forest fire risk assessment.
To make the model accessible, I developed a web application using Flask, a Python web framework.
The application is deployed on AWS Elastic Beanstalk, with continuous integration and deployment facilitated by AWS CodePipeline.
- Explore notebook to understand the implementation and evaluation of different regression models, along with data visualization
Hosted this web application using Flask and deployed on AWS
-
Clone the GitHub Repository:
- Open your terminal or command prompt.
- Navigate to the directory where you want to clone the repository.
- Run the following command to clone my GitHub repository:
git clone https://github.com/my-username/my-repo.git
- Replace
my-username
with my GitHub username andmy-repo
with the name of my repository.
-
Install Python:
- If you haven't already, make sure you have Python installed on your system. You can download it from the official Python website (https://www.python.org/downloads/) and follow the installation instructions for your operating system.
-
Create a Virtual Environment (Optional but recommended):
- It's a good practice to create a virtual environment to isolate the dependencies of your project. You can create a virtual environment using the following command:
python -m venv venv
- It's a good practice to create a virtual environment to isolate the dependencies of your project. You can create a virtual environment using the following command:
-
Activate the Virtual Environment (Optional but recommended):
- Activate the virtual environment using the appropriate command based on your operating system:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
- Activate the virtual environment using the appropriate command based on your operating system:
-
Install Required Packages:
- Navigate to the root folder of your cloned repository.
- Run the following command to install the required Python packages listed in the
requirements.txt
file:pip install -r requirements.txt
-
Run the Flask Application:
- Once the packages are installed, you can start your Flask application. In your repository's root folder, you should typically have a file named
application.py
, which is the main Flask application file. - Run the application with the following command:
python application.py
- Once the packages are installed, you can start your Flask application. In your repository's root folder, you should typically have a file named
-
Access the Application:
- Your Flask application should now be running. You can access it in your web browser by navigating to
http://localhost:5000
or the URL provided by your application.
- Your Flask application should now be running. You can access it in your web browser by navigating to
-
Fork the GitHub Repository:
- Click the "Fork" button in the top-right corner of this repository's page.
- This action will create a copy of my repository under your GitHub account.
- Use this as a source for deploying application in AWS
-
Deploy application using ELastic Beanstalk and Code Pipeline in AWS
- Follow the steps in this Article for deploying Web application in AWS. URL - https://dev.to/wardaliaqat01/cicd-pipeline-hands-on-aws-code-pipeline-elastic-beanstalk-github-35n3