blob: 707ef92df176748de66cfab85dfa634b9ec59ff0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import joblib
import pandas as pd
# Load the model
model = joblib.load('model.pkl')
# Sample data for prediction
data = {
'Kilometers_Driven': [50000],
'Fuel_Type': ['Petrol'],
'Transmission': ['Manual'],
'Owner_Type': ['First'],
'Engine CC': [1197],
'Power': [82],
'Seats': [5],
'Car_Age': [6],
'Location': ['Mumbai']
}
# Convert to DataFrame
input_data = pd.DataFrame(data)
# Predict
predicted_mileage = model.predict(input_data)
print(f"Predicted Mileage: {predicted_mileage[0]:.2f} Km/L")
|