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