summaryrefslogblamecommitdiffstats
path: root/predict.py
blob: 707ef92df176748de66cfab85dfa634b9ec59ff0 (plain) (tree)
1
             
























                                                            
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")