Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- es
|
5 |
+
tags:
|
6 |
+
- machine-learning
|
7 |
+
- random-forest
|
8 |
+
- fuel-consumption
|
9 |
+
- tabular-regression
|
10 |
+
license: apache-2.0
|
11 |
+
datasets:
|
12 |
+
- your_dataset_name
|
13 |
+
metrics:
|
14 |
+
- mean_absolute_error
|
15 |
+
- r2_score
|
16 |
+
model_name: Fuel Burn Prediction Model
|
17 |
+
model_description: >
|
18 |
+
This model predicts fuel consumption in kilograms based on truck ID,
|
19 |
+
kilometers driven, and fuel consumption in liters using a
|
20 |
+
RandomForestRegressor model.
|
21 |
+
widget:
|
22 |
+
- input:
|
23 |
+
- type: text
|
24 |
+
label: Truck ID
|
25 |
+
example: Truck_ID
|
26 |
+
- type: number
|
27 |
+
label: Kms Driven
|
28 |
+
example: 100000
|
29 |
+
- type: number
|
30 |
+
label: Litros (Fuel Consumed)
|
31 |
+
example: 150
|
32 |
+
output:
|
33 |
+
- type: number
|
34 |
+
label: Predicted Fuel Burn (kg)
|
35 |
+
score: 125.25
|
36 |
+
base_model: RandomForestRegressor
|
37 |
+
library_name: scikit-learn
|
38 |
+
---
|
39 |
+
|
40 |
+
# Fuel Burn Prediction Model
|
41 |
+
|
42 |
+
## Model Overview
|
43 |
+
This is a **RandomForestRegressor** model designed to predict **fuel burn** in **kilograms** based on three key features:
|
44 |
+
- **Truck ID**: Identifier of the truck (e.g., `Truck_ID`).
|
45 |
+
- **Kms Driven**: The number of kilometers the truck has driven.
|
46 |
+
- **Litros (Fuel Consumed)**: The amount of fuel consumed in liters.
|
47 |
+
|
48 |
+
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.
|
49 |
+
|
50 |
+
## Model Specifications
|
51 |
+
- **Algorithm**: Random Forest Regressor
|
52 |
+
- **Input Features**:
|
53 |
+
- Truck ID (Categorical, one-hot encoded)
|
54 |
+
- Kilometers driven (Continuous)
|
55 |
+
- Fuel consumption in liters (Continuous)
|
56 |
+
- **Output**:
|
57 |
+
- Predicted fuel burn (in kilograms)
|
58 |
+
|
59 |
+
### Model Performance
|
60 |
+
- **R-squared (R²)**: 0.9996 on the test set.
|
61 |
+
- **Mean Absolute Error (MAE)**: 0.1513.
|
62 |
+
- **Mean Squared Error (MSE)**: Low, showing strong model performance.
|
63 |
+
|
64 |
+
These metrics indicate that the model performs exceptionally well on the test set and can generalize to unseen data with high accuracy.
|
65 |
+
|
66 |
+
## Usage
|
67 |
+
|
68 |
+
You can load this model using `joblib` and use it to predict fuel consumption for new truck data.
|
69 |
+
|
70 |
+
### Example Usage:
|
71 |
+
|
72 |
+
```python
|
73 |
+
import joblib
|
74 |
+
import pandas as pd
|
75 |
+
|
76 |
+
# Load the model
|
77 |
+
model = joblib.load('fuel_burn_model.pkl')
|
78 |
+
|
79 |
+
# Example input data
|
80 |
+
input_data = pd.DataFrame({
|
81 |
+
'Truck_ID': [0], # Truck_ID
|
82 |
+
'Kms': [100000], # Kilometers driven
|
83 |
+
'Litros': [150] # Fuel consumption in liters
|
84 |
+
})
|
85 |
+
|
86 |
+
# Predict fuel burn in kilograms
|
87 |
+
predicted_fuel_burn = model.predict(input_data)
|
88 |
+
print(f"Predicted fuel burn: {predicted_fuel_burn[0]:.2f} kg")
|