Commit
·
7541c42
1
Parent(s):
6d15d6e
Update app.py
Browse files
app.py
CHANGED
@@ -108,12 +108,29 @@ def get_user_input():
|
|
108 |
|
109 |
user_input, submit_button = get_user_input()
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
# When the 'Submit' button is pressed, perform the prediction
|
112 |
if submit_button:
|
113 |
# Predict wine quality
|
114 |
prediction = pipe.predict(user_input)
|
115 |
prediction_value = prediction[0]
|
116 |
|
|
|
|
|
117 |
# Display the prediction
|
118 |
st.header("Predicted Quality")
|
119 |
-
st.write(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
user_input, submit_button = get_user_input()
|
110 |
|
111 |
+
quality_mapping = {
|
112 |
+
3: "Worst quality (3)",
|
113 |
+
4: "Low quality (4)",
|
114 |
+
5: "Medium-to-low quality (5)",
|
115 |
+
6: "Medium-to-high quality (6)",
|
116 |
+
7: "Good quality (7)",
|
117 |
+
8: "Best quality (8)"
|
118 |
+
}
|
119 |
+
|
120 |
# When the 'Submit' button is pressed, perform the prediction
|
121 |
if submit_button:
|
122 |
# Predict wine quality
|
123 |
prediction = pipe.predict(user_input)
|
124 |
prediction_value = prediction[0]
|
125 |
|
126 |
+
prediction_text = quality_mapping[prediction_value]
|
127 |
+
|
128 |
# Display the prediction
|
129 |
st.header("Predicted Quality")
|
130 |
+
st.write(prediction_text)
|
131 |
+
|
132 |
+
st.markdown(
|
133 |
+
"""
|
134 |
+
[See how this model was created on Kaggle: 🍷 Wine Quality - EDA, Prediction and Deploy](https://www.kaggle.com/code/lusfernandotorres/wine-quality-eda-prediction-and-deploy/notebook)
|
135 |
+
"""
|
136 |
+
)
|