summaryrefslogtreecommitdiffstats
path: root/predict.py
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-11-27 16:58:22 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-11-27 16:58:22 +0530
commit9f56376d64bf3307b18cd67d0fe8aaf5a6860f11 (patch)
tree515f39ebb936cabe9f5598c6fd784d64dd7eab88 /predict.py
downloadautopredict-9f56376d64bf3307b18cd67d0fe8aaf5a6860f11.tar.gz
autopredict-9f56376d64bf3307b18cd67d0fe8aaf5a6860f11.tar.bz2
autopredict-9f56376d64bf3307b18cd67d0fe8aaf5a6860f11.zip
Data Pridiction of Cars
Diffstat (limited to 'predict.py')
-rw-r--r--predict.py26
1 files changed, 26 insertions, 0 deletions
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")