Update app.py
Browse files
app.py
CHANGED
|
@@ -17,30 +17,30 @@ product_types = [
|
|
| 17 |
# Collect user input for property features
|
| 18 |
Product_Id = st.text_input("Id")
|
| 19 |
Product_Weight = st.number_input("Weight of Product", min_value=1.00)
|
| 20 |
-
Product_MRP = st.number_input("MRP of Product", min_value=1.00)
|
| 21 |
-
Product_Allocated_Area = st.number_input("Allocated_Area", max_value=1.000)
|
| 22 |
Product_Sugar_Content = st.selectbox("Sugar Content", ["Low Sugar", "Regular", "No Sugar"])
|
|
|
|
| 23 |
Product_Type = st.selectbox("Type", product_types)
|
|
|
|
|
|
|
|
|
|
| 24 |
Store_Size = st.selectbox("Store Size", ["Medium", "High", "Small"])
|
| 25 |
Store_Location_City_Type = st.selectbox("Store Location Type", ["Tier 1", "Tier 2", "Tier 3"])
|
| 26 |
Store_Type = st.text_input("Store_Type")
|
| 27 |
-
Store_Id = st.text_input("Store Id")
|
| 28 |
-
Store_Establishment_Year = st.number_input("Store Establishment Year", min_value=1950, max_value=2025, step=1)
|
| 29 |
|
| 30 |
|
| 31 |
# Convert user input into a DataFrame
|
| 32 |
input_data = pd.DataFrame([{
|
| 33 |
'Product_Id': Product_Id,
|
| 34 |
'Product_Weight': Product_Weight,
|
| 35 |
-
'Product_MRP': Product_MRP,
|
| 36 |
-
'Product_Allocated_Area': Product_Allocated_Area,
|
| 37 |
'Product_Sugar_Content': Product_Sugar_Content,
|
|
|
|
| 38 |
'Product_Type': Product_Type,
|
|
|
|
|
|
|
|
|
|
| 39 |
'Store_Size': Store_Size,
|
| 40 |
'Store_Location_City_Type': Store_Location_City_Type,
|
| 41 |
-
'Store_Type': Store_Type
|
| 42 |
-
'Store_Id': Store_Id,
|
| 43 |
-
'Store_Establishment_Year': Store_Establishment_Year
|
| 44 |
}])
|
| 45 |
|
| 46 |
# Make prediction when the "Predict" button is clicked
|
|
@@ -50,4 +50,4 @@ if st.button("Predict"):
|
|
| 50 |
prediction = response.json()['Predicted Price']
|
| 51 |
st.success(f"Predicted Price: {prediction}")
|
| 52 |
else:
|
| 53 |
-
st.error("Error making prediction.")
|
|
|
|
| 17 |
# Collect user input for property features
|
| 18 |
Product_Id = st.text_input("Id")
|
| 19 |
Product_Weight = st.number_input("Weight of Product", min_value=1.00)
|
|
|
|
|
|
|
| 20 |
Product_Sugar_Content = st.selectbox("Sugar Content", ["Low Sugar", "Regular", "No Sugar"])
|
| 21 |
+
Product_Allocated_Area = st.number_input("Allocated_Area", max_value=1.000)
|
| 22 |
Product_Type = st.selectbox("Type", product_types)
|
| 23 |
+
Product_MRP = st.number_input("MRP of Product", min_value=1.00)
|
| 24 |
+
Store_Id = st.text_input("Store Id")
|
| 25 |
+
Store_Establishment_Year = st.number_input("Store Establishment Year", min_value=1950, max_value=2025, step=1)
|
| 26 |
Store_Size = st.selectbox("Store Size", ["Medium", "High", "Small"])
|
| 27 |
Store_Location_City_Type = st.selectbox("Store Location Type", ["Tier 1", "Tier 2", "Tier 3"])
|
| 28 |
Store_Type = st.text_input("Store_Type")
|
|
|
|
|
|
|
| 29 |
|
| 30 |
|
| 31 |
# Convert user input into a DataFrame
|
| 32 |
input_data = pd.DataFrame([{
|
| 33 |
'Product_Id': Product_Id,
|
| 34 |
'Product_Weight': Product_Weight,
|
|
|
|
|
|
|
| 35 |
'Product_Sugar_Content': Product_Sugar_Content,
|
| 36 |
+
'Product_Allocated_Area': Product_Allocated_Area,
|
| 37 |
'Product_Type': Product_Type,
|
| 38 |
+
'Product_MRP': Product_MRP,
|
| 39 |
+
'Store_Id': Store_Id,
|
| 40 |
+
'Store_Establishment_Year': Store_Establishment_Year,
|
| 41 |
'Store_Size': Store_Size,
|
| 42 |
'Store_Location_City_Type': Store_Location_City_Type,
|
| 43 |
+
'Store_Type': Store_Type
|
|
|
|
|
|
|
| 44 |
}])
|
| 45 |
|
| 46 |
# Make prediction when the "Predict" button is clicked
|
|
|
|
| 50 |
prediction = response.json()['Predicted Price']
|
| 51 |
st.success(f"Predicted Price: {prediction}")
|
| 52 |
else:
|
| 53 |
+
st.error("Error making prediction.")
|