-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
26 lines (18 loc) · 750 Bytes
/
app.py
File metadata and controls
26 lines (18 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import streamlit as st
import numpy as np
import pickle
model = pickle.load(open('model.pkl', 'rb'))
st.title('What is IRIS?')
sepal_length = st.slider("Sepal Length ",0.1,5.8)
sepal_width = st.slider("Sepal Width ",0.1,5.8)
petal_length = st.slider("Petal Length ",0.1,5.8)
petal_width = st.slider("Petal Width ",0.1,5.8)
def predict():
float_features = [float(x) for x in [sepal_length, sepal_width, petal_length, petal_width]]
final_features = [np.array(float_features)]
prediction = model.predict(final_features)
label = prediction[0]
print(type(label))
print(label)
st.success('The Flower is : ' + str(label) + ' :thumbsup:')
trigger = st.button('Predict', on_click=predict)