From 9f56376d64bf3307b18cd67d0fe8aaf5a6860f11 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Wed, 27 Nov 2024 16:58:22 +0530 Subject: Data Pridiction of Cars --- predict.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 predict.py (limited to 'predict.py') diff --git a/predict.py b/predict.py new file mode 100644 index 0000000..6864f9c --- /dev/null +++ b/predict.py @@ -0,0 +1,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") -- cgit v1.2.3-59-g8ed1b