shikharyashmaurya commited on
Commit
aff9f53
1 Parent(s): 0c808cd

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +88 -0
  2. model.py +4 -0
app.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+
3
+ # new_data = pd.DataFrame({
4
+ # 'gender':0,
5
+ # 'ssc_p':55.0,
6
+ # 'ssc_b':0,
7
+ # 'hsc_p':75.0,
8
+ # 'hsc_b':0,
9
+ # 'hsc_s':1,
10
+ # 'degree_p':65.0,
11
+ # 'degree_t':2,
12
+ # 'workex':0,
13
+ # 'etest_p':55.0,
14
+ # 'specialisation':1,
15
+ # 'mba_p':58.8,
16
+ # },index=[0])
17
+
18
+ import joblib
19
+
20
+ model = joblib.load('model_campus_placement')
21
+
22
+ # p=model.predict(new_data)
23
+ # prob=model.predict_proba(new_data)
24
+
25
+ # if p[0]==1:
26
+ # print('Placed')
27
+ # print(f"You will be placed with probability of {prob[0][1]:.2f}")
28
+ # else:
29
+ # print("Not-placed")
30
+
31
+ import streamlit as st
32
+
33
+ st.title('Campus-Placement-Prediction-Using-Machine-Learning')
34
+
35
+ gender=st.number_input('gender',value=0)
36
+ ssc_p=st.number_input('ssc_p',value=0)
37
+ ssc_b=st.number_input('ssc_b',value=0)
38
+ hsc_p=st.number_input('hsc_p',value=0)
39
+ hsc_b=st.number_input('hsc_b',value=0)
40
+ hsc_s=st.number_input('hsc_s',value=0)
41
+ degree_p=st.number_input('degree_p',value=0)
42
+ degree_t=st.number_input('degree_t',value=0)
43
+ workex=st.number_input('workex',value=0)
44
+ etest_p=st.number_input('etest_p',value=0)
45
+ specialisation=st.number_input('specialisation',value=0)
46
+ mba_p=st.number_input('mba_p',value=0)
47
+
48
+ if st.button('submit'):
49
+
50
+ new_data = pd.DataFrame({
51
+ 'gender':gender,
52
+ 'ssc_p':ssc_p,
53
+ 'ssc_b':ssc_b,
54
+ 'hsc_p':hsc_p,
55
+ 'hsc_b':hsc_b,
56
+ 'hsc_s':hsc_s,
57
+ 'degree_p':degree_p,
58
+ 'degree_t':degree_t,
59
+ 'workex':workex,
60
+ 'etest_p':etest_p,
61
+ 'specialisation':specialisation,
62
+ 'mba_p':mba_p,
63
+ },index=[0])
64
+
65
+ p=model.predict(new_data)
66
+ prob=model.predict_proba(new_data)
67
+
68
+
69
+ if p[0]==1:
70
+ # print('Placed')
71
+ st.write('Placed')
72
+ # print(f"You will be placed with probability of {prob[0][1]:.2f}")
73
+ st.write(f"You will be placed with probability of {prob[0][1]:.2f}")
74
+
75
+ else:
76
+ # print("Not-placed")
77
+ st.write('Not-placed')
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
model.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ import pandas as pd
2
+ data = pd.read_csv('D:\Downloads\Campus-Placement-Prediction-Using-Machine-Learning-main\Campus-Placement-Prediction-Using-Machine-Learning-main\Placement_Data_Full_Class (1).csv')
3
+ import warnings
4
+ warnings.filterwarnings('ignore')