Spaces:
Sleeping
Sleeping
Update app.py
Browse files1123430 unmodified lines3536373839404142434445464748495051525354555657585960616263646566676869import gradio as gr'''import gradio as grimport pickleimport pandas as pd
30 unmodified lines
# Launch the Gradio interfaceiface.launch()'''import gradio as grimport pickleimport numpy as np
# Load the trained modelwith open("model-svm.pkl", "rb") as f: model = pickle.load(f)
def predict_pcos(age, weight, height, bmi, pulse_rate, cycle_length): input_data = np.array([[age, weight, height, bmi, pulse_rate, cycle_length]]) prediction = model.predict(input_data) return "Positive" if prediction[0] == 1 else "Negative"
# Define the Gradio interfaceinterface = gr.Interface( fn=predict_pcos, inputs=[ gr.Number(label="Age (yrs)"), gr.Number(label="Weight (Kg)"), gr.Number(label="Height (Cm)"), gr.Number(label="BMI"), gr.Number(label="Pulse rate(bpm)"), gr.Number(label="Cycle length(days)") ], outputs=gr.Textbox(label="PCOS Prediction"), title="PCOS Detection Model", description="Predicts the likelihood of PCOS based on user input features.")
# Launch the Gradio appinterface.launch()app.py+33-1