alinaL commited on
Commit
ea196a8
1 Parent(s): 918ccf8
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. app.py +13 -4
  3. simple_rf_model.pickle +3 -0
.gitattributes CHANGED
@@ -25,3 +25,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
25
  *.zip filter=lfs diff=lfs merge=lfs -text
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
25
  *.zip filter=lfs diff=lfs merge=lfs -text
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
28
+ *.pickle filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -1,7 +1,16 @@
1
  import gradio as gr
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!!"
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from sklearn.ensemble import RandomForestRegressor
3
+ import pickle
4
 
5
+ def predict_price(area, year, if_center, if_senamiestis, rooms):
6
+ x = pd.DataFrame([{'details__Plotas': area, 'details__Metai': year, 'seniunija__Centras': if_center,
7
+ 'seniunija__Senamiestis': if_senamiestis, 'details__Kambarių sk.': rooms}])
8
 
9
+ return float(rf.predict(x))
10
+
11
+
12
+ filename = 'simple_rf_model.pickle'
13
+ loaded_model = pickle.load(open(filename, 'rb'))
14
+
15
+ iface = gr.Interface(fn=predict_price, inputs="text", outputs="text")
16
+ iface.launch()
simple_rf_model.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62e235586e4ffea2603a9bec471197a93d24c166b5bd98ef13b2e1b05c623701
3
+ size 17463874