summaryrefslogtreecommitdiffstats
path: root/predict.py
blob: 6864f9c1d7a61be2636e51ff5d245e0d24e570fb (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
mport 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")