frrnnda7 commited on
Commit
e05e59f
1 Parent(s): 628c3dd

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +55 -0
  2. my_model.pkl +3 -0
app.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
14
+ df = pd.read_csv('https://raw.githubusercontent.com/ardhiraka/PFDS_sources/master/campus.csv')
15
+
16
+ gender = st.selectbox('Gender', df['gender'].unique())
17
+ ssc = st.number_input('Secondary School Points', value=67.00)
18
+ hsc = st.number_input('High School Points', 0.0, value=91.0)
19
+ hsc_s = st.selectbox('High School Spec', df['hsc_s'].unique())
20
+ degree_p = st.number_input('Degree Points', 0.0, value=58.0)
21
+ degree_t = st.selectbox('Degree Spec', df['degree_t'].unique())
22
+ workex = st.selectbox('Work Experience?', df['workex'].unique())
23
+ etest_p = st.number_input('Etest Points', 0.0, value=78.00)
24
+ spec = st.selectbox('Specialization', df['specialisation'].unique())
25
+ mba_p = st.number_input('MBA Points', 0.0, value=54.55)
26
+
27
+ data = {
28
+ 'gender': gender,
29
+ 'ssc_p': ssc,
30
+ 'hsc_p': hsc,
31
+ 'hsc_s': hsc_s,
32
+ 'degree_p': degree_p,
33
+ 'degree_t': degree_t,
34
+ 'workex': workex,
35
+ 'etest_p': etest_p,
36
+ 'specialisation':spec,
37
+ 'mba_p': mba_p
38
+ }
39
+ input = pd.DataFrame(data, index=[0])
40
+
41
+ st.subheader('User Input')
42
+ st.write(input)
43
+
44
+ load_model = joblib.load("my_model.pkl")
45
+
46
+ if st.button('Predict'):
47
+ prediction = load_model.predict(input)
48
+
49
+ if prediction == 1:
50
+ prediction = 'Placed'
51
+ else:
52
+ prediction = 'Not Placed'
53
+
54
+ st.write('Based on user input, the placement model predicted: ')
55
+ 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