Spaces:
Build error
Build error
File size: 1,304 Bytes
499ba04 cab2317 499ba04 f7ebabd | 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | import pandas as pd
import gradio as gr
import joblib
model = joblib.load('KNeighborsClassifier.pkl') # Adjust if needed
def Students_Performance_Prediction_Model(Q,A,ME,ASS,Ag,FE,CG,T):
try:
input_data=pd.DataFrame({
'Quiz01 [10]':[Q],
'Assignment01 [8]':[A],
'Midterm Exam [20]':[ME],
'Assignment02 [12]':[ASS],
'Assignment03 [25]':[Ag],
'Final Exam [35]':[FE],
'Course Grade':[CG],
'Total [100]':[T]
})
prediction=model.predict(input_data)
if prediction[0]==0:
return 'G'
else:
return 'W'
except Exception as e:
return str(e)
gr.Interface(
inputs=[
gr.Number(label='Quiz01 [10]'),
gr.Number(label='Assignment01 [8]'),
gr.Number(label='Midterm Exam [20]'),
gr.Number(label='Assignment02 [12]'),
gr.Number(label='Assignment03 [25]'),
gr.Number(label='Final Exam [35]'),
gr.Number(label='Course Grade'),
gr.Number(label='Total [100]')
],
fn=Students_Performance_Prediction_Model,
outputs=gr.Textbox(label='Prediction Risk'),
title='prediction Program',
description='This program for predict Score Risk of Students'
).launch() |