umair894 commited on
Commit
92eee0e
·
verified ·
1 Parent(s): b64a311

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -0
app.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import joblib
3
+ import sklearn
4
+ lr_model = joblib.load("lr_model.sav")
5
+
6
+
7
+
8
+ def predict_plan(parent_income, iq, gender, encourage):
9
+ """
10
+ Predicts the student's plan based on the input features.
11
+ """
12
+ input_data = [parent_income, iq, gender, encourage]
13
+ prediction = lr_model.predict([input_data])[0]
14
+ print(prediction)
15
+ return "Plan" if prediction == "True" else "No Plan"
16
+
17
+ iface = gr.Interface(
18
+ fn=predict_plan,
19
+ inputs=[
20
+ gr.Number(label="Parent Income"),
21
+ gr.Number(label="IQ"),
22
+ gr.Checkbox(label="Gender (Male)"),
23
+ gr.Checkbox(label="Encourage")
24
+ ],
25
+ outputs="text",
26
+ title="Student Plan Prediction",
27
+ description="Enter student information to predict their plan."
28
+ )
29
+
30
+ iface.launch(debug = True)