alinaL commited on
Commit
81b56f4
1 Parent(s): 747f6bd

xgboost model update

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -5,20 +5,6 @@ from xgboost import XGBRegressor
5
  import pickle
6
  import pandas as pd
7
 
8
- # filename = 'simple_rf_model.pickle'
9
- # rf = pickle.load(open(filename, 'rb'))
10
- #
11
- # def predict_price(area, year, if_center, if_senamiestis, rooms):
12
- # x = pd.DataFrame([{'details__Plotas': area, 'details__Metai': year, 'seniunija__Centras': int(if_center),
13
- # 'seniunija__Senamiestis': int(if_senamiestis), 'details__Kambarių sk.': rooms}])
14
- # print(x)
15
- # return float(rf.predict(x))
16
- #
17
- #
18
- # iface = gr.Interface(fn=predict_price, inputs=[gr.inputs.Slider(10, 200, 1, 80), gr.inputs.Slider(1950, 2022, 1, 2010),
19
- # "checkbox", "checkbox", gr.inputs.Slider(1, 5, 1, 2)], outputs="text")
20
- # iface.launch()
21
-
22
  filename = 'xgboost_model_all.pickle'
23
  xgb = pickle.load(open(filename, 'rb'))
24
 
@@ -61,3 +47,17 @@ iface = gr.Interface(fn=predict_price, inputs=[gr.inputs.Slider(10, 180, 1, 80),
61
  "checkbox",
62
  ], outputs="text")
63
  iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  import pickle
6
  import pandas as pd
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  filename = 'xgboost_model_all.pickle'
9
  xgb = pickle.load(open(filename, 'rb'))
10
 
 
47
  "checkbox",
48
  ], outputs="text")
49
  iface.launch()
50
+
51
+ # filename = 'simple_rf_model.pickle'
52
+ # rf = pickle.load(open(filename, 'rb'))
53
+ #
54
+ # def predict_price(area, year, if_center, if_senamiestis, rooms):
55
+ # x = pd.DataFrame([{'details__Plotas': area, 'details__Metai': year, 'seniunija__Centras': int(if_center),
56
+ # 'seniunija__Senamiestis': int(if_senamiestis), 'details__Kambarių sk.': rooms}])
57
+ # print(x)
58
+ # return float(rf.predict(x))
59
+ #
60
+ #
61
+ # iface = gr.Interface(fn=predict_price, inputs=[gr.inputs.Slider(10, 200, 1, 80), gr.inputs.Slider(1950, 2022, 1, 2010),
62
+ # "checkbox", "checkbox", gr.inputs.Slider(1, 5, 1, 2)], outputs="text")
63
+ # iface.launch()