| import pickle as pk |
| import gradio as gr |
| import numpy as np |
| import pandas as pd |
| from sklearn.linear_model import LinearRegression |
| loaded_model = pk.load(open("score_predict.pkl", "rb"), encoding="bytes") |
|
|
| def predict_my_score(hours_of_study): |
| input_arr = [[hours_of_study]] |
| y_predict_new = loaded_model.predict(input_arr) |
| return int(y_predict_new[0][0]) |
|
|
| interface = gr.Interface(predict_my_score, title = "Predict My Score ", |
| description = "Enter the hours you study per day and know your score.", inputs = "number", outputs = |
| "number") |
| interface.launch(share = True) |