File size: 554 Bytes
7d770b1
 
 
96583e8
7d770b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import pickle
import pandas as pd
import sklearn

def predict(x1,x2):

    new_data = pd.DataFrame({'Floor space of the shop':[x1],
                             'Distance to the nearest station':[x2]}
                            ) 
         # Load the trained model
    with open('modelo_regresion.pkl', 'rb') as f:
        model = pickle.load(f)
    y_pred = model.predict(new_data) 
    return y_pred[0]


if __name__ == "__main__":
    demo = gr.Interface(fn=predict, inputs=["number","number"], outputs="number")
    demo.launch()