forked from kavynabel/iliwycmbd_streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiris_app.py
62 lines (35 loc) · 1.74 KB
/
iris_app.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Import packages
import pandas as pd
import pickle
import altair as alt
''' Make title'''
''' Streamlit Write Command'''
'''Load Data rename columns '''
#iris = pd.read_csv('https://raw.githubusercontent.com/byuibigdata/iliwycmbd_streamlit/main/iris.csv')
#iris = iris.rename(columns={'sepal.length': 'sepallength', 'sepal.width': 'sepalwidth', 'petal.length': 'petallength', 'petal.width': 'petalwidth'})
''' For the ml model dedicate which columns will be your feature under 'X' and our target under 'Y'''
#X = iris.loc[:, iris.columns != 'variety']
#Y = iris.loc[:, iris.columns == 'variety']
# add a subheader explaining what the ml model will do
''' Add a title for your sidebar '''
# st.sidebar.header('Specify Input Parameters')
''' bellow is the code to add sliders and to connect them to a dataset which we will use for our ml model. Add a slider for sepal length'''
#def user_input_features():
# sepalwidth = st.sidebar.slider('Sepal Width', 0.1,8.1,4.0, step=.1)
# petallength = st.sidebar.slider('Petal Length',0.1,2.1,1.1, step=.1)
# petalwidth = st.sidebar.slider('Petal Width', 0.1,2.1,1.1, step=.1)
#data ={ 'sepalwidth':sepalwidth,
# 'petalwidth':petalwidth,
# 'petallength':petallength
#}
#features = pd.DataFrame(data, index=[0])
#return features
#df = user_input_features()
''' load pickel with our ml model'''
#load_clf = pickle.load(open('work/iliwycmbd_streamlit/irirs_model.pkl', 'rb'))
''' load prediction and prediction probability '''
#prediction = load_clf.predict(df)
#prediction_proba = load_clf.predict_proba(df)
#prediction = prediction[0]
''' display the data that the user inputed and display the prediction '''
''' add any charts, visuals or widgets that you would like '''