Views
No views yet
Truck_ID).joblib and use it to predict fuel consumption for new truck data.1import joblib
2import pandas as pd
3
4# Load the model
5model = joblib.load('fuel_burn_model.pkl')
6
7# Example input data
8input_data = pd.DataFrame({
9 'Truck_ID': [0], # Use the numerical representation of the Truck ID(1,2,3)
10 'Kms': [100000], # Kilometers driven
11 'Litros': [150] # Fuel consumption in liters
12})
13
14# Predict fuel burn in kilograms
15predicted_fuel_burn = model.predict(input_data)
16print(f"Predicted fuel burn: {predicted_fuel_burn[0]:.2f} kg")