galihsukmana commited on
Commit
dba74a7
1 Parent(s): 00b45b5

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +63 -0
  2. my_model.pkl +3 -0
app.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import joblib
4
+
5
+ st.header('FTDS Model Deployment')
6
+ st.write("""
7
+ Created by FTDS Curriculum Team
8
+
9
+ Use the sidebar to select input features.
10
+ """)
11
+
12
+ @st.cache
13
+ def fetch_data():
14
+ df = pd.read_csv('https://raw.githubusercontent.com/ardhiraka/PFDS_sources/master/campus.csv')
15
+ return df
16
+
17
+ df = fetch_data()
18
+
19
+ def user_input():
20
+ gender = st.selectbox('Gender', df['gender'].unique())
21
+ ssc = st.number_input('Secondary School Points', value=67.00)
22
+ hsc = st.number_input('High School Points', 0.0, value=91.0)
23
+ hsc_s = st.selectbox('High School Spec', df['hsc_s'].unique())
24
+ degree_p = st.number_input('Degree Points', 0.0, value=58.0)
25
+ degree_t = st.selectbox('Degree Spec', df['degree_t'].unique())
26
+ workex = st.selectbox('Work Experience?', df['workex'].unique())
27
+ etest_p = st.number_input('Etest Points', 0.0, value=78.00)
28
+ spec = st.selectbox('Specialization', df['specialisation'].unique())
29
+ mba_p = st.number_input('MBA Points', 0.0, value=54.55)
30
+
31
+ data = {
32
+ 'gender': gender,
33
+ 'ssc_p': ssc,
34
+ 'hsc_p': hsc,
35
+ 'hsc_s': hsc_s,
36
+ 'degree_p': degree_p,
37
+ 'degree_t': degree_t,
38
+ 'workex': workex,
39
+ 'etest_p': etest_p,
40
+ 'specialisation':spec,
41
+ 'mba_p': mba_p
42
+ }
43
+ features = pd.DataFrame(data, index=[0])
44
+ return features
45
+
46
+
47
+ input = user_input()
48
+
49
+ st.subheader('User Input')
50
+ st.write(input)
51
+
52
+ load_model = joblib.load("my_model.pkl")
53
+
54
+ if st.button('Predict'):
55
+ prediction = load_model.predict(input)
56
+
57
+ if prediction == 1:
58
+ prediction = 'Placed'
59
+ else:
60
+ prediction = 'Not Placed'
61
+
62
+ st.write('Based on user input, the placement model predicted: ')
63
+ st.write(prediction)
my_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:044c3279b2bda005ba401e82d9a8b90b9b677f1d5585406c45f962399e36e892
3
+ size 6115