f64
commited on
Commit
·
ed424f6
1
Parent(s):
bc6facb
- pages/2_TECT_IDXYZ.py +10 -1
pages/2_TECT_IDXYZ.py
CHANGED
|
@@ -34,6 +34,14 @@ def GetListOf_XYZV_ToTrainClassifier(repo):
|
|
| 34 |
lstDfOriginal = [my_stm.df_process_v_column(df) for df in dictTrainThreeDataframes.values()]
|
| 35 |
return lstDfOriginal
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
def ReRun() :
|
| 38 |
try: st.rerun()
|
| 39 |
except: pass
|
|
@@ -128,7 +136,8 @@ if selectedFile is not None:
|
|
| 128 |
#col1.dataframe(dfShow, height=400)
|
| 129 |
pack_size = list(set(dgID.apply(len)))[0]
|
| 130 |
lstDfOriginal = GetListOf_XYZV_ToTrainClassifier(REPO)
|
| 131 |
-
classifier_object, df_train_with_predict, time_elapsed = my_stm.GetClassifier(lstDfOriginal, pack_size-1)
|
|
|
|
| 132 |
col2.popover(type(classifier_object).__name__).write(type(classifier_object))
|
| 133 |
# прогноз на обучающей выборке
|
| 134 |
columns_xyzv = [c for c in df_train_with_predict.columns if "Vis" in c] + [c for c in df_train_with_predict.columns if c[0] in "XYZ"]
|
|
|
|
| 34 |
lstDfOriginal = [my_stm.df_process_v_column(df) for df in dictTrainThreeDataframes.values()]
|
| 35 |
return lstDfOriginal
|
| 36 |
|
| 37 |
+
@st.cache_data
|
| 38 |
+
def GetCachedClassifier(lstDfOriginal, nHystorySteps):
|
| 39 |
+
classifier_object, df_train_with_predict, time_elapsed = my_stm.GetClassifier(lstDfOriginal, nHystorySteps)
|
| 40 |
+
st.session_state.df_train_with_predict = df_train_with_predict
|
| 41 |
+
print(f"GetCachedClassifier() : {time_elapsed=}")
|
| 42 |
+
return classifier_object
|
| 43 |
+
|
| 44 |
+
|
| 45 |
def ReRun() :
|
| 46 |
try: st.rerun()
|
| 47 |
except: pass
|
|
|
|
| 136 |
#col1.dataframe(dfShow, height=400)
|
| 137 |
pack_size = list(set(dgID.apply(len)))[0]
|
| 138 |
lstDfOriginal = GetListOf_XYZV_ToTrainClassifier(REPO)
|
| 139 |
+
#classifier_object, df_train_with_predict, time_elapsed = my_stm.GetClassifier(lstDfOriginal, pack_size-1)
|
| 140 |
+
classifier_object = GetCachedClassifier(lstDfOriginal, pack_size-1)
|
| 141 |
col2.popover(type(classifier_object).__name__).write(type(classifier_object))
|
| 142 |
# прогноз на обучающей выборке
|
| 143 |
columns_xyzv = [c for c in df_train_with_predict.columns if "Vis" in c] + [c for c in df_train_with_predict.columns if c[0] in "XYZ"]
|