Spaces:
Running
Running
Commit
·
dc7b249
1
Parent(s):
0adf255
fix pandas issue
Browse files- app.py +2 -1
- expense_forecast/Expense_Forecasting.py +1 -1
app.py
CHANGED
@@ -12,7 +12,8 @@ app = Flask(__name__)
|
|
12 |
CORS(app, resources={r"/*": {"origins": [
|
13 |
'http://localhost:3000',
|
14 |
'http://localhost:8080',
|
15 |
-
'https://wealthmate.onrender.com'
|
|
|
16 |
]}})
|
17 |
|
18 |
@app.route('/monthly_expense_prediction', methods=['POST'])
|
|
|
12 |
CORS(app, resources={r"/*": {"origins": [
|
13 |
'http://localhost:3000',
|
14 |
'http://localhost:8080',
|
15 |
+
'https://wealthmate.onrender.com',
|
16 |
+
'https://kennethduong-wealthmate.hf.space'
|
17 |
]}})
|
18 |
|
19 |
@app.route('/monthly_expense_prediction', methods=['POST'])
|
expense_forecast/Expense_Forecasting.py
CHANGED
@@ -50,7 +50,7 @@ def get_input_data(income, interest_rate, inflation_rate, holidays):
|
|
50 |
return input_data
|
51 |
|
52 |
def forecast_expense(model_fit, input_data, df):
|
53 |
-
if (input_data['Income (VND)'] < 5000000):
|
54 |
return input_data['Income (VND)'] * 0.78492
|
55 |
forecast = model_fit.predict(start=len(df), end=len(df), exog=input_data)
|
56 |
return forecast.iloc[0]
|
|
|
50 |
return input_data
|
51 |
|
52 |
def forecast_expense(model_fit, input_data, df):
|
53 |
+
if (input_data['Income (VND)'].iloc[0] < 5000000):
|
54 |
return input_data['Income (VND)'] * 0.78492
|
55 |
forecast = model_fit.predict(start=len(df), end=len(df), exog=input_data)
|
56 |
return forecast.iloc[0]
|