Update app.py
Browse files
app.py
CHANGED
@@ -11,21 +11,21 @@ def main():
|
|
11 |
st.title("Colors Prediction")
|
12 |
|
13 |
with st.form("questionaire"):
|
14 |
-
|
15 |
|
16 |
clicked = st.form_submit_button("Predict Color")
|
17 |
if clicked:
|
18 |
-
result=model.predict(pd.DataFrame({"Color":[
|
19 |
#result=model.predict(pd.DataFrame({"Room": [room],
|
20 |
# "Partitions": [partition],
|
21 |
# "Rows": [rows],
|
22 |
# "Columns": [columns],
|
23 |
# "Color": [color]}))
|
24 |
-
|
25 |
#result = 'Red' = Red if result[0] == 1 else 'Blue'
|
26 |
st.success('The predicted color is {}'.format(predicted_color))
|
27 |
|
28 |
-
def
|
29 |
if prediction == 'Red':
|
30 |
return 'Red'
|
31 |
elif prediction == 'Blue':
|
|
|
11 |
st.title("Colors Prediction")
|
12 |
|
13 |
with st.form("questionaire"):
|
14 |
+
Color = st.selectbox("Color", unique_Color)
|
15 |
|
16 |
clicked = st.form_submit_button("Predict Color")
|
17 |
if clicked:
|
18 |
+
result=model.predict(pd.DataFrame({"Color":[Color]}))
|
19 |
#result=model.predict(pd.DataFrame({"Room": [room],
|
20 |
# "Partitions": [partition],
|
21 |
# "Rows": [rows],
|
22 |
# "Columns": [columns],
|
23 |
# "Color": [color]}))
|
24 |
+
predicted_Color = predict_Color(result)
|
25 |
#result = 'Red' = Red if result[0] == 1 else 'Blue'
|
26 |
st.success('The predicted color is {}'.format(predicted_color))
|
27 |
|
28 |
+
def predict_Color(prediction):
|
29 |
if prediction == 'Red':
|
30 |
return 'Red'
|
31 |
elif prediction == 'Blue':
|