Logo Lanfrica

JescapsAntwi/fuel-predictor

Domain:

mobility

Record type:

model
Creator:
Jes
Host:
Final project from our Intro to AI course: a fuel prediction system for Ghana’s Satellite Trans Limited. We built a machine learning model to forecast fuel consumption, helping the logistics company optimize usage, cut costs, and improve fleet efficiency through data-driven insights. # Fuel Prediction Model This project demonstrates the steps involved in building a fuel consumption prediction model using a dataset of fuel expenses and vehicle information. The model aims to predict the number of gallons of fuel required for a given trip based on factors like the cargo type, vehicle weight class, distance, and fuel price. This is our final project for our introduction to AI course at Ashesi University. This notebook is hosted on Google Colab and walks through the following steps: 1. **Data Cleaning** 2. **Data Visualization** 3. **Cargo & Vehicle Classification** 4. **Data Preprocessing (One-hot encoding & Standardization)** 5. **Model Training** 6. **Model Evaluation** 7. **Saving the Model** 8. **Prediction with Gradio Interface** --- ## 💾 Getting Started ### 1. Mount Google Drive The first step is to mount your Google Drive to load the dataset. This can be done directly in the notebook using the following snippet: ```python from google.colab import drive drive.mount('/content/drive') ``` ### 2. Load the Dataset The dataset is loaded from an Excel file stored in your Google Drive: ```python df = pd.read_excel('/content/drive/MyDrive/Colab Notebooks/FuelData.xlsx') ``` ### 3. Data Cleaning First, the dataset is cleaned by checking for missing values and performing necessary preprocessing. Missing values are identified, and any rows with NaN are dropped during the later stages. ```python print("Missing values:\n", df.isnull().sum()) ``` --- ## 📊 Data Visualization ### Monthly Fuel Expenses A line plot is created to visualize monthly fuel expenses by grouping data by the month: ```python sns.lineplot(data=monthly_expense, x='Month', y='Fuelprice New GHC', marker='o') ``` ### Average Fuel Consumption by Cargo A bar plot is created to visualize average fuel consumption per cargo type: ```python sns.barplot(x='Cargo', y='Gallons', data=avg_fuel_consumption) ``` --- ## ⚙️ Data Preprocessing ### Cargo Weight Classification The cargo …