Spaces:
Sleeping
Sleeping
import numpy as np | |
import joblib | |
import gradio as gr | |
import pandas as pd | |
import pickle | |
# with open('maakdi.pkl','rb') as file: | |
# loaded_model=pickle.load(file) | |
loaded_model = joblib.load('./updated.joblib_') | |
def predict_rank(NATIONAL,Institution_name, Academic_Reputation_score, Academic_Reputation_rank, Employer_Reputation_score, Employer_Reputation_rank, Faculty_Student_score, Faculty_Student_rank, Citations_per_Faculty_score, Citations_per_Faculty_rank, International_Faculty_score, International_Students_score, International_Students_rank): | |
input_data = np.array([NATIONAL, Institution_name, Academic_Reputation_score, Academic_Reputation_rank, Employer_Reputation_score, Employer_Reputation_rank, Faculty_Student_score, Faculty_Student_rank, Citations_per_Faculty_score, Citations_per_Faculty_rank, International_Faculty_score, International_Students_score,International_Students_rank]).reshape(1, -1) | |
predict_score = loaded_model.predict(input_data) | |
return f"Predicted Rank: {np.round(predict_score[0], 2)}" | |
C11 = gr.components.Slider(minimum=1, maximum=1401, label='NATIONAL') | |
C22 = gr.components.Slider(minimum=0, maximum=1700, label='Institution name') | |
C23 = gr.components.Slider(minimum=1, maximum=100, label='Academic Reputation Score') | |
C33 = gr.components.Slider(minimum=1, maximum=601, label='Academic Reputation Rank') | |
C44 = gr.components.Slider(minimum=1, maximum=100, label='Employer Reputation score') | |
C55 = gr.components.Slider(minimum=1, maximum=601, label='Employer Reputation rank') | |
C66 = gr.components.Slider(minimum=1, maximum=100, label='Faculty Student score') | |
C77 = gr.components.Slider(minimum=1, maximum=701, label='Faculty Student rank') | |
C88 = gr.components.Slider(minimum=1, maximum=100, label='Citations per Faculty score') | |
C99 = gr.components.Slider(minimum=1, maximum=701, label='Citations per Faculty rank') | |
C100 = gr.components.Slider(minimum=1, maximum=100, label='International Faculty score') | |
C101 = gr.components.Slider(minimum=1, maximum=100, label='International Students score') | |
C102 = gr.components.Slider(minimum=1, maximum=701,label='International Students rank') | |
op = gr.components.Textbox(label="Overall_score") | |
iface = gr.Interface(fn=predict_rank, inputs=[C11, C22,C23, C33, C44, C55, C66, C77, C88, C99, C100, C101, C102], theme='HaleyCH/HaleyCH_Theme', outputs=op) | |
iface.launch() | |