File size: 599 Bytes
5264e0f
 
 
 
 
 
 
 
a299736
 
 
5264e0f
2d7730e
5264e0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)