umair894's picture
Create app.py
92eee0e verified
raw
history blame contribute delete
769 Bytes
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)