diff options
Diffstat (limited to 'predict.py')
-rw-r--r-- | predict.py | 41 |
1 files changed, 28 insertions, 13 deletions
@@ -25,23 +25,38 @@ def predict(input_data): return mileage, price, int(year) -# Sample data for prediction -data = { - 'Year': 2022, - 'Kilometers_Driven': 30000, - 'Fuel_Type': 'Petrol', - 'Transmission': 'Manual', - 'Owner_Type': 'First', - 'Location': 'Mumbai', - 'Engine CC': 1200, - 'Power': 85, - 'Seats': 5 -} +def collect_input(): + print("Enter the car details for prediction:") + year = int(input("Year of Manufacture (e.g., 2022): ")) + kilometers_driven = int(input("Kilometers Driven (e.g., 30000): ")) + fuel_type = input("Fuel Type (Petrol/Diesel/CNG/Electric): ") + transmission = input("Transmission (Manual/Automatic): ") + owner_type = input("Owner Type (First/Second/Third/Fourth & Above): ") + location = input("Location (e.g., Mumbai): ") + engine_cc = int(input("Engine Capacity in CC (e.g., 1200): ")) + power = float(input("Power in BHP (e.g., 85): ")) + seats = int(input("Number of Seats (e.g., 5): ")) + + return { + 'Year': year, + 'Kilometers_Driven': kilometers_driven, + 'Fuel_Type': fuel_type, + 'Transmission': transmission, + 'Owner_Type': owner_type, + 'Location': location, + 'Engine CC': engine_cc, + 'Power': power, + 'Seats': seats + } + + +# Collect input data from the user +data = collect_input() # Make prediction - predicted_mileage, predicted_price, predicted_year = predict(data) +print("\nPrediction Results:") print(f"Predicted Mileage (Km/L): {predicted_mileage:.2f}") print(f"Predicted Price: ₹{predicted_price:,.2f} Lakhs") print(f"Predicted Year: {predicted_year}") |