Spaces:
Runtime error
Runtime error
luisotorres
commited on
Commit
•
995c130
1
Parent(s):
5d52132
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import joblib
|
4 |
+
|
5 |
+
pipe = joblib.load('wine_quality_prediction.pkl')
|
6 |
+
|
7 |
+
def get_user_input():
|
8 |
+
input_dict = {}
|
9 |
+
for feat in selected_features:
|
10 |
+
input_value = st.number_input(f"Enter {feat} value", value=0.0, step=0.01)
|
11 |
+
input_dict[feat] = input_value
|
12 |
+
return pd.DataFrame([input_dict])
|
13 |
+
|
14 |
+
|
15 |
+
st.title("Wine Quality Prediction")
|
16 |
+
|
17 |
+
user_input = get_user_input()
|
18 |
+
|
19 |
+
prediction = pipe.predict(user_input)
|
20 |
+
|
21 |
+
st.subheader("Prediction")
|
22 |
+
st.write(prediction[0])
|