|
--- |
|
language: |
|
- en |
|
- es |
|
tags: |
|
- machine-learning |
|
- random-forest |
|
- fuel-consumption |
|
- tabular-regression |
|
license: apache-2.0 |
|
metrics: |
|
- mean_absolute_error |
|
- r2_score |
|
model_name: Fuel Burn Prediction Model |
|
model_description: > |
|
This model predicts fuel consumption in kilograms based on truck ID, |
|
kilometers driven, and fuel consumption in liters using a |
|
RandomForestRegressor model. |
|
widget: |
|
- input: |
|
- type: text |
|
label: Truck ID |
|
example: Truck_ID |
|
- type: number |
|
label: Kms Driven |
|
example: 100000 |
|
- type: number |
|
label: Litros (Fuel Consumed) |
|
example: 150 |
|
output: |
|
- type: number |
|
label: Predicted Fuel Burn (kg) |
|
score: 125.25 |
|
base_model: RandomForestRegressor |
|
library_name: scikit-learn |
|
--- |
|
|
|
# Fuel Burn Prediction Model |
|
|
|
## Model Overview |
|
This is a **RandomForestRegressor** model designed to predict **fuel burn** in **kilograms** based on three key features: |
|
- **Truck ID**: Identifier of the truck (e.g., `Truck_ID`). |
|
- **Kms Driven**: The number of kilometers the truck has driven. |
|
- **Litros (Fuel Consumed)**: The amount of fuel consumed in liters. |
|
|
|
The model is trained using historical data of trucks, which includes fuel consumption and distances driven. It predicts fuel consumption (in kilograms) given the truck's specific parameters. |
|
|
|
## Model Specifications |
|
- **Algorithm**: Random Forest Regressor |
|
- **Input Features**: |
|
- Truck ID (Categorical, one-hot encoded) |
|
- Kilometers driven (Continuous) |
|
- Fuel consumption in liters (Continuous) |
|
- **Output**: |
|
- Predicted fuel burn (in kilograms) |
|
|
|
### Model Performance |
|
- **R-squared (R²)**: 0.9996 on the test set. |
|
- **Mean Absolute Error (MAE)**: 0.1513. |
|
- **Mean Squared Error (MSE)**: Low, showing strong model performance. |
|
|
|
These metrics indicate that the model performs exceptionally well on the test set and can generalize to unseen data with high accuracy. |
|
|
|
## Usage |
|
|
|
You can load this model using `joblib` and use it to predict fuel consumption for new truck data. |
|
|
|
### Example Usage: |
|
|
|
```python |
|
import joblib |
|
import pandas as pd |
|
|
|
# Load the model |
|
model = joblib.load('fuel_burn_model.pkl') |
|
|
|
# Example input data |
|
input_data = pd.DataFrame({ |
|
'Truck_ID': [0], # Use the numerical representation of the Truck ID(1,2,3) |
|
'Kms': [100000], # Kilometers driven |
|
'Litros': [150] # Fuel consumption in liters |
|
}) |
|
|
|
# Predict fuel burn in kilograms |
|
predicted_fuel_burn = model.predict(input_data) |
|
print(f"Predicted fuel burn: {predicted_fuel_burn[0]:.2f} kg") |