Spaces:
Runtime error
Runtime error
Commit
·
c93b890
1
Parent(s):
5e80c1b
adsf
Browse files
app.py
CHANGED
@@ -266,16 +266,18 @@ def getDates():
|
|
266 |
|
267 |
def sthlm(streetName, number, sqm, rooms, monthlyFee, monthlyCost, floor, yearBuilt, auto):
|
268 |
lat, lon = getAddressInfo(streetName, number)
|
269 |
-
|
270 |
# If none
|
271 |
if lat is None or lon is None:
|
272 |
return '', 'Address not found in the OpenStreetMap dataset (Nominatim), please try another address'
|
|
|
273 |
|
274 |
agency = 'Notar' # Make fun if categorical works
|
275 |
brf = 'BRF Kartboken 1' # TODO: remove
|
276 |
dates = getDates()
|
277 |
input_variables = pd.DataFrame(
|
278 |
columns=columnHeaders)
|
|
|
279 |
|
280 |
for soldDate in dates.keys():
|
281 |
# gdp, unemployment, interestRate = getFinancialInfo(soldDate)
|
@@ -285,9 +287,12 @@ def sthlm(streetName, number, sqm, rooms, monthlyFee, monthlyCost, floor, yearBu
|
|
285 |
input_variables = input_variables.append(
|
286 |
pd.DataFrame(
|
287 |
[[streetName,number,sqm,rooms,soldDate,monthlyFee,monthlyCost,floor,yearBuilt,brf,agency,lat,lon]], columns=columnHeaders))
|
|
|
288 |
|
289 |
df = populateApartmentData(input_variables)
|
|
|
290 |
df = normalizeData(df)
|
|
|
291 |
df = xgbFix(df)
|
292 |
|
293 |
pricePred = None
|
@@ -295,7 +300,9 @@ def sthlm(streetName, number, sqm, rooms, monthlyFee, monthlyCost, floor, yearBu
|
|
295 |
# pricePred = autoPred(df)
|
296 |
'', 'Autogluon is not working right now, please try again later'
|
297 |
else:
|
|
|
298 |
pricePred = xgboostPred(df)
|
|
|
299 |
|
300 |
explanations = list(dates.values())
|
301 |
result = []
|
|
|
266 |
|
267 |
def sthlm(streetName, number, sqm, rooms, monthlyFee, monthlyCost, floor, yearBuilt, auto):
|
268 |
lat, lon = getAddressInfo(streetName, number)
|
269 |
+
print('1')
|
270 |
# If none
|
271 |
if lat is None or lon is None:
|
272 |
return '', 'Address not found in the OpenStreetMap dataset (Nominatim), please try another address'
|
273 |
+
print('2')
|
274 |
|
275 |
agency = 'Notar' # Make fun if categorical works
|
276 |
brf = 'BRF Kartboken 1' # TODO: remove
|
277 |
dates = getDates()
|
278 |
input_variables = pd.DataFrame(
|
279 |
columns=columnHeaders)
|
280 |
+
print('3')
|
281 |
|
282 |
for soldDate in dates.keys():
|
283 |
# gdp, unemployment, interestRate = getFinancialInfo(soldDate)
|
|
|
287 |
input_variables = input_variables.append(
|
288 |
pd.DataFrame(
|
289 |
[[streetName,number,sqm,rooms,soldDate,monthlyFee,monthlyCost,floor,yearBuilt,brf,agency,lat,lon]], columns=columnHeaders))
|
290 |
+
print('4')
|
291 |
|
292 |
df = populateApartmentData(input_variables)
|
293 |
+
print('5')
|
294 |
df = normalizeData(df)
|
295 |
+
print('6')
|
296 |
df = xgbFix(df)
|
297 |
|
298 |
pricePred = None
|
|
|
300 |
# pricePred = autoPred(df)
|
301 |
'', 'Autogluon is not working right now, please try again later'
|
302 |
else:
|
303 |
+
print('7')
|
304 |
pricePred = xgboostPred(df)
|
305 |
+
print('8')
|
306 |
|
307 |
explanations = list(dates.values())
|
308 |
result = []
|