123ahmed commited on
Commit
7fdff00
·
verified ·
1 Parent(s): 9fda97c

Upload 5 files

Browse files
Files changed (5) hide show
  1. app.py +46 -0
  2. le_col.pkl +3 -0
  3. model.pkl +3 -0
  4. requirements.txt +4 -0
  5. std_col.pkl +3 -0
app.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import pandas as pd
3
+ import gradio as gr
4
+ import joblib
5
+
6
+ std=joblib.load('std_col.pkl')
7
+ lr=joblib.load('model.pkl')
8
+
9
+
10
+ std_col=['GPA', 'Test Score', 'Extracurricular Activities', 'Volunteer Hours','Recommendation Letters', 'Essay Score']
11
+
12
+
13
+
14
+
15
+ def predict_admission(gpa, ts, ea, vh, rl, es):
16
+ try:
17
+ input_data = pd.DataFrame(
18
+ {
19
+ "GPA":[gpa],
20
+ "Test Score":[ts],
21
+ "Extracurricular Activities":[ea],
22
+ "Volunteer Hours":[vh],
23
+ "Recommendation Letters":[rl],
24
+ "Essay Score":[es]}
25
+ )
26
+
27
+ input_data[std_col]=std.transform(input_data[std_col])
28
+ prediction = lr.predict(input_data)
29
+ if prediction[0] == 0:
30
+ return "No"
31
+ else:
32
+ return "Yes"
33
+ except Exception as e:
34
+ return str(e)
35
+ gr.Interface(
36
+ inputs= [
37
+
38
+ gr.Number(label="GPA"),
39
+ gr.Number(label="Test Score"),
40
+ gr.Number(label="Extracurricular Activities"),
41
+ gr.Number(label="Volunteer Hours"),
42
+ gr.Number(label="Recommendation Letters"),
43
+ gr.Number(label="Essay Score")
44
+ ],
45
+ fn = predict_admission, outputs= gr.Textbox(label="Admission Decision")
46
+ ).launch()
le_col.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:afebf6c623345666acc74c154973995bd849136a8a03e8afcec6623aebff9e64
3
+ size 360
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72f77b1d17dab96a69ae44593a885198d56a540d1c53abdc1034b6ca3fb44a9c
3
+ size 1343
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ gradio
2
+ pandas
3
+ joblib
4
+ scikit-learn
std_col.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82f9d6b8512df3d5eec72b4e4fa27440fa579256341463178448eff416533d3e
3
+ size 1175