Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
import numpy as np
import joblib
from sklearn.metrics import roc_curve
import logging

# Configure logging
logging.basicConfig(
filename='app.log',
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)

xgb_model = joblib.load("pkl_files/xgboost_model.pkl")
scaler = joblib.load("pkl_files/scaler.pkl")
Expand Down Expand Up @@ -97,4 +105,5 @@ def investment_strategy(predicted, vix, usgg3m, gold_threshold=1500):
st.line_chart(portfolio_growth)

except Exception as e:
st.error(f"An error occurred: {e}")
logging.error(f"Error in prediction: {str(e)}", exc_info=True)
st.error("An error occurred while processing your request. Please check the input values.")
1 change: 1 addition & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@