File size: 462 Bytes
e113a71
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import numpy as np
import gradio as gr
#function to predict the input hours
def predict_score(hours):
    #hours = np.array(hours)
    pred_score = -0.5738734424645411 + 2.1659122905141825*hours
    return   pred_score     #np.round(pred_score[0], 2)
input = gr.inputs.Number(label='Number of Hours studied')
output = gr.outputs.Textbox(label='Predicted Score')
gr.Interface( fn=predict_score,
              inputs=input,
              outputs=output).launch();