The Vehicle Risk Prediction application is designed to predict the risk associated with driving a vehicle based on various factors such as weather conditions, road hazards, visibility, traffic density, and driver-related factors like fatigue level, speeding, and medical conditions. The application utilizes a machine learning model trained on historical data to provide risk predictions.
'The aim is to create a web app for the Vehicle Live Risk Prediction project. Use the best existing model in the project folder. Follow the Web App README template for the same.'
XGBoost (Extreme Gradient Boosting) is a powerful and widely-used machine learning algorithm known for its efficiency and effectiveness in predictive modeling tasks. It belongs to the ensemble learning methods, specifically boosting algorithms, and has gained popularity for its exceptional performance in various machine learning competitions and real-world applications.
Before running the application, ensure you have Python and pip installed on your system.
- Open your terminal or command prompt.
- Navigate to the project directory.
- Create a virtual environment using the following command:
python -m venv myenv
- Activate the virtual environment:
- On Windows:
venv\Scripts\activate - On macOS/Linux:
source venv/bin/activate
While the virtual environment is activated, install the required packages using pip:
pip install -r requirements.txt
After installing the requirements, run the Streamlit application using the following command:
streamlit run app.py
- Input Fields: Users can enter details such as Visibility, Road Surface Conditions, Weather, Traffic Density, Road Hazards, Fatigue Level, Medical Condition, Speeding, and Light Condition.
- Prediction: After entering the required information and clicking on the "Predict Risk" button, the application calculates the risk level (High Risk or Low Risk) based on the user's input.
- Data Overview: Displays the first few rows of the dataset and provides an overview of the data.
- Data Statistics: Shows summary statistics of numerical columns in the dataset.
- Correlation Heatmap: Visualizes the correlation between numerical features using a heatmap.
- Countplots of Categorical Features: Displays count plots for each categorical feature in the dataset.
- Model Explanation (XGBoost): Provides an explanation of the machine learning model used in the application, focusing on the XGBoost (Extreme Gradient Boosting) algorithm.
- Purpose: Explains the purpose and goal of the Vehicle Risk Prediction application.
The Vehicle Risk Prediction application is built using the following technologies:
- Streamlit: Used for building the user interface and web application.
- Pandas: Used for data manipulation and handling input data.
- Joblib: Used for loading the machine learning model, encoders, and scaler.
- XGBoost: Machine learning algorithm used for risk prediction.
- Navigation: Use the sidebar to navigate between the Main Model Page, Visualization Page, and About Page.
- Main Model Page:
- Fill in all required fields with relevant information.
- Click on the "Predict Risk" button to see the risk prediction.
- Visualization Page:
- Explore data overview, statistics, correlations, countplots, and pairplots to gain insights into the dataset.
- About Page:
- Provides information about the model explanation and purpose of the application.
Name:-Shivansh Mahajan
Github:-https://github.com/shivansh-2003
Linkedin:-https://www.linkedin.com/in/shivansh-mahajan-13227824a/
