File size: 769 Bytes
92eee0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr
import joblib
import sklearn
lr_model = joblib.load("lr_model.sav")



def predict_plan(parent_income, iq, gender, encourage):
  """
  Predicts the student's plan based on the input features.
  """
  input_data = [parent_income, iq, gender, encourage]
  prediction = lr_model.predict([input_data])[0]
  print(prediction)
  return "Plan" if prediction == "True" else "No Plan"

iface = gr.Interface(
    fn=predict_plan,
    inputs=[
        gr.Number(label="Parent Income"),
        gr.Number(label="IQ"),
        gr.Checkbox(label="Gender (Male)"),
        gr.Checkbox(label="Encourage")
    ],
    outputs="text",
    title="Student Plan Prediction",
    description="Enter student information to predict their plan."
)

iface.launch(debug = True)