Update .gitattributes
Browse files- .gitattributes +34 -35
.gitattributes
CHANGED
|
@@ -1,35 +1,34 @@
|
|
| 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 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import joblib
|
| 3 |
+
import pandas as pd
|
| 4 |
+
|
| 5 |
+
# Load the trained model
|
| 6 |
+
model_path = "random_forest_model.pkl"
|
| 7 |
+
model = joblib.load(model_path)
|
| 8 |
+
|
| 9 |
+
# Title of the web app
|
| 10 |
+
st.title("🚗 Car Price Prediction")
|
| 11 |
+
|
| 12 |
+
# Input fields for user
|
| 13 |
+
brand = st.text_input("Brand", "BMW")
|
| 14 |
+
model_name = st.text_input("Model", "320i")
|
| 15 |
+
year = st.number_input("Year", min_value=2000, max_value=2024, value=2018)
|
| 16 |
+
mileage = st.number_input("Mileage (in km)", min_value=0, max_value=500000, value=50000)
|
| 17 |
+
fuel_type = st.selectbox("Fuel Type", ["Petrol", "Diesel", "Hybrid", "Electric"])
|
| 18 |
+
engine_size = st.number_input("Engine Size (in liters)", min_value=0.5, max_value=6.0, value=2.0)
|
| 19 |
+
|
| 20 |
+
# Prediction function
|
| 21 |
+
def predict_price(brand, model_name, year, mileage, fuel_type, engine_size):
|
| 22 |
+
# Create a DataFrame for input
|
| 23 |
+
input_data = pd.DataFrame([[brand, model_name, year, mileage, fuel_type, engine_size]],
|
| 24 |
+
columns=["Brand", "Model", "Year", "Mileage", "Fuel Type", "Engine Size"])
|
| 25 |
+
|
| 26 |
+
# Make prediction
|
| 27 |
+
prediction = model.predict(input_data)
|
| 28 |
+
|
| 29 |
+
return f"Estimated Price: {prediction[0]:,.2f} €"
|
| 30 |
+
|
| 31 |
+
# Button to make a prediction
|
| 32 |
+
if st.button("Predict Price"):
|
| 33 |
+
result = predict_price(brand, model_name, year, mileage, fuel_type, engine_size)
|
| 34 |
+
st.success(result)
|
|
|