Update app.py
Browse files
app.py
CHANGED
|
@@ -78,14 +78,14 @@ elif social_acc_nav == 'About App':
|
|
| 78 |
|
| 79 |
|
| 80 |
# Loading Machine Learning Objects
|
| 81 |
-
@st.
|
| 82 |
def Load_ml_items(relative_path):
|
| 83 |
"Load ML items to reuse them"
|
| 84 |
with open(relative_path, 'rb') as file:
|
| 85 |
loaded_object1 = pickle.load(file)
|
| 86 |
return loaded_object1
|
| 87 |
|
| 88 |
-
@st.
|
| 89 |
def Load_ml_items(relative_path):
|
| 90 |
"Load ML items to reuse them"
|
| 91 |
with open(relative_path, 'rb') as file:
|
|
@@ -104,7 +104,7 @@ Loaded_object = Load_ml_items('ml_items_1')
|
|
| 104 |
pipeline, stores, holidays_event = Loaded_object['pipeline'], Loaded_object['stores'], Loaded_object['holidays_event']
|
| 105 |
train_data= loaded_object1['train_data']
|
| 106 |
# Setting Function for extracting Calendar features
|
| 107 |
-
@st.
|
| 108 |
|
| 109 |
def getDateFeatures(df, date ):
|
| 110 |
df['date'] = pd.to_datetime(df[date])
|
|
@@ -125,7 +125,7 @@ def getDateFeatures(df, date ):
|
|
| 125 |
return df
|
| 126 |
|
| 127 |
# Setting up variables for input data
|
| 128 |
-
@st.
|
| 129 |
def setup(tmp_df_file):
|
| 130 |
"Setup the required elements like files, models, global variables, etc"
|
| 131 |
pd.DataFrame(
|
|
|
|
| 78 |
|
| 79 |
|
| 80 |
# Loading Machine Learning Objects
|
| 81 |
+
@st.cache_data(allow_output_mutation=True)
|
| 82 |
def Load_ml_items(relative_path):
|
| 83 |
"Load ML items to reuse them"
|
| 84 |
with open(relative_path, 'rb') as file:
|
| 85 |
loaded_object1 = pickle.load(file)
|
| 86 |
return loaded_object1
|
| 87 |
|
| 88 |
+
@st.cache_data(allow_output_mutation=True)
|
| 89 |
def Load_ml_items(relative_path):
|
| 90 |
"Load ML items to reuse them"
|
| 91 |
with open(relative_path, 'rb') as file:
|
|
|
|
| 104 |
pipeline, stores, holidays_event = Loaded_object['pipeline'], Loaded_object['stores'], Loaded_object['holidays_event']
|
| 105 |
train_data= loaded_object1['train_data']
|
| 106 |
# Setting Function for extracting Calendar features
|
| 107 |
+
@st.cache_data(allow_output_mutation=True)
|
| 108 |
|
| 109 |
def getDateFeatures(df, date ):
|
| 110 |
df['date'] = pd.to_datetime(df[date])
|
|
|
|
| 125 |
return df
|
| 126 |
|
| 127 |
# Setting up variables for input data
|
| 128 |
+
@st.cache_data()
|
| 129 |
def setup(tmp_df_file):
|
| 130 |
"Setup the required elements like files, models, global variables, etc"
|
| 131 |
pd.DataFrame(
|