YeBhoneLin10 commited on
Commit
224cd09
·
verified ·
1 Parent(s): 983df9b

Upload 3 files

Browse files
Files changed (3) hide show
  1. main.py +25 -0
  2. model.pkl +3 -0
  3. requirements.txt +3 -0
main.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pickle
3
+ import pandas as pd
4
+
5
+ st.title("Classification the Iris")
6
+
7
+ sepal_length = st.text_input('Sepal_Length (cm)')
8
+ sepal_width = st.text_input('Sepal_Width (cm)')
9
+ petal_length = st.text_input('Petal_Length (cm)')
10
+ petal_width = st.text_input('Petal_Width (cm)')
11
+
12
+ dataframe = pd.DataFrame({"sepal length (cm)":[sepal_length],"sepal width (cm)":[sepal_width],'petal length (cm)':[petal_length],'petal width (cm)':[petal_width]})
13
+
14
+ if st.button('Prediction'):
15
+ with open('model.pkl', 'rb') as file:
16
+ loaded_model = pickle.load(file)
17
+ final_output = loaded_model.predict(dataframe)
18
+ if final_output == '0':
19
+ st.write("The output class is setosa")
20
+ elif final_output == '1':
21
+ st.write("The output class is versicolor")
22
+ elif final_output == '2':
23
+ st.write("The output class is virginica")
24
+
25
+
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b5bafc94b2a5cce583143571238404c3332de71d8b1e4dc20ef8ad6f4e103f4
3
+ size 993
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ pandas
2
+ pickle
3
+ streamlit