File size: 651 Bytes
c947d15
d4c76b7
35cfab5
c947d15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
import pickle
import sklearn
with open('svm_model.pickle', 'rb') as f:
  model = pickle.load(f)
    
def predfunction(income_group, area_req, nature, budget):
  income_group = float(income_group)
  area_req = float(area_req)
  nature = float(nature)
  budget = float(budget)
  testing = [income_group, area_req, nature, budget]
  X_new = np.array([[income_group, area_req, nature, budget]])
  prediction = model.predict(X_new)
  return prediction[0]

demo = gr.Interface(
    fn=predfunction,
    inputs=["text", "text", "text", "text"],
    outputs=gr.Textbox(label="Best Suited Location For Shop"),
)

demo.launch(inline = False)