Anshini commited on
Commit
c66ffd2
·
verified ·
1 Parent(s): 97147c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -16,7 +16,7 @@ pickup_long = st.number_input("Pickup Longitude")
16
  dropoff_lat = st.number_input("Dropoff Latitude")
17
  dropoff_long = st.number_input("Dropoff Longitude")
18
  passenger_count = st.number_input("Passenger Count", min_value=1, max_value=6, step=1)
19
- pickup_datetime = st.text_input("Pickup Date & Time (YYYY-MM-DD HH:MM:SS)")
20
 
21
  # Prediction
22
  if st.button("Predict Fare"):
@@ -27,8 +27,17 @@ if st.button("Predict Fare"):
27
  'dropoff_latitude': dropoff_lat,
28
  'dropoff_longitude': dropoff_long,
29
  'passenger_count': passenger_count,
30
- 'pickup_datetime': pickup_datetime
31
  }])
 
 
 
 
 
 
 
 
 
 
32
 
33
  predicted_fare = model.predict(input_data)[0]
34
  st.success(f"Estimated Fare: ${predicted_fare:.2f}")
 
16
  dropoff_lat = st.number_input("Dropoff Latitude")
17
  dropoff_long = st.number_input("Dropoff Longitude")
18
  passenger_count = st.number_input("Passenger Count", min_value=1, max_value=6, step=1)
19
+ # pickup_datetime = st.text_input("Pickup Date & Time (YYYY-MM-DD HH:MM:SS)")
20
 
21
  # Prediction
22
  if st.button("Predict Fare"):
 
27
  'dropoff_latitude': dropoff_lat,
28
  'dropoff_longitude': dropoff_long,
29
  'passenger_count': passenger_count,
 
30
  }])
31
+ # if st.button("Predict Fare"):
32
+ # # Prepare input as a DataFrame with correct column names
33
+ # input_data = pd.DataFrame([{
34
+ # 'pickup_latitude': pickup_lat,
35
+ # 'pickup_longitude': pickup_long,
36
+ # 'dropoff_latitude': dropoff_lat,
37
+ # 'dropoff_longitude': dropoff_long,
38
+ # 'passenger_count': passenger_count,
39
+ # 'pickup_datetime': pickup_datetime
40
+ # }])
41
 
42
  predicted_fare = model.predict(input_data)[0]
43
  st.success(f"Estimated Fare: ${predicted_fare:.2f}")