Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import streamlit.components.v1 as components
|
|
| 5 |
from sklearn.preprocessing import LabelEncoder
|
| 6 |
le = LabelEncoder()
|
| 7 |
|
|
|
|
| 8 |
# Load the pickled model
|
| 9 |
def load_model():
|
| 10 |
return pickle.load(open('Waiter_tips_Prediction_linear.pkl', 'rb')) #change
|
|
@@ -27,7 +28,7 @@ def app_design():
|
|
| 27 |
st.subheader("Enter the following values:") #change
|
| 28 |
|
| 29 |
smoker = st.text_input("smoker")
|
| 30 |
-
smoker =
|
| 31 |
total_bill = st.number_input("total_bill")
|
| 32 |
|
| 33 |
sex = st.selectbox("sex",('Male','Female'))
|
|
@@ -35,12 +36,11 @@ def app_design():
|
|
| 35 |
Sex = 1
|
| 36 |
else:
|
| 37 |
Sex = 0
|
| 38 |
-
|
| 39 |
size = st.number_input("size")
|
| 40 |
day = st.text_input("day")
|
| 41 |
-
day =
|
| 42 |
time = st.text_input("time")
|
| 43 |
-
time =
|
| 44 |
|
| 45 |
|
| 46 |
|
|
|
|
| 5 |
from sklearn.preprocessing import LabelEncoder
|
| 6 |
le = LabelEncoder()
|
| 7 |
|
| 8 |
+
|
| 9 |
# Load the pickled model
|
| 10 |
def load_model():
|
| 11 |
return pickle.load(open('Waiter_tips_Prediction_linear.pkl', 'rb')) #change
|
|
|
|
| 28 |
st.subheader("Enter the following values:") #change
|
| 29 |
|
| 30 |
smoker = st.text_input("smoker")
|
| 31 |
+
smoker = le.fit_transform(['smoker'])
|
| 32 |
total_bill = st.number_input("total_bill")
|
| 33 |
|
| 34 |
sex = st.selectbox("sex",('Male','Female'))
|
|
|
|
| 36 |
Sex = 1
|
| 37 |
else:
|
| 38 |
Sex = 0
|
|
|
|
| 39 |
size = st.number_input("size")
|
| 40 |
day = st.text_input("day")
|
| 41 |
+
day = le.fit_transform(['day'])
|
| 42 |
time = st.text_input("time")
|
| 43 |
+
time = le.fit_transform(['time'])
|
| 44 |
|
| 45 |
|
| 46 |
|