Compare commits

...

2 Commits

Author SHA1 Message Date
ab8110e59b 解决mlstm保存错误问题 2025-07-23 18:15:49 +08:00
4ed92a1bc6 完善预测页面的筛选 2025-07-23 17:49:49 +08:00
5 changed files with 10 additions and 20 deletions

View File

@ -116,12 +116,12 @@ const filters = reactive({
const pagination = reactive({
currentPage: 1,
pageSize: 8
pageSize: 12
})
const filteredModelList = computed(() => {
return modelList.value.filter(model => {
const modelTypeMatch = !filters.model_type || model.model_type === filters.model_type
const modelTypeMatch = !filters.model_type || model.model_type === filters.model_type.id
return modelTypeMatch
})
})

View File

@ -125,13 +125,13 @@ const filters = reactive({
const pagination = reactive({
currentPage: 1,
pageSize: 8
pageSize: 12
})
const filteredModelList = computed(() => {
return modelList.value.filter(model => {
const productMatch = !filters.product_id || model.product_id === filters.product_id
const modelTypeMatch = !filters.model_type || model.model_type === filters.model_type
const modelTypeMatch = !filters.model_type || model.model_type === filters.model_type.id
return productMatch && modelTypeMatch
})
})

View File

@ -126,7 +126,7 @@ const filters = reactive({
const pagination = reactive({
currentPage: 1,
pageSize: 8
pageSize: 12
})
const storeNameMap = computed(() => {
@ -146,7 +146,7 @@ const modelsWithNames = computed(() => {
const filteredModelList = computed(() => {
return modelsWithNames.value.filter(model => {
const storeMatch = !filters.store_id || model.store_id === filters.store_id
const modelTypeMatch = !filters.model_type || model.model_type === filters.model_type
const modelTypeMatch = !filters.model_type || model.model_type === filters.model_type.id
return storeMatch && modelTypeMatch
})
})

View File

@ -132,7 +132,7 @@ def train_with_cnn_bilstm_attention(product_id, model_identifier, product_df, st
loss_curve_path = plot_loss_curve(
loss_history['train'],
loss_history['val'],
product_name,
model_identifier,
'cnn_bilstm_attention',
model_dir=model_dir
)

View File

@ -393,19 +393,9 @@ def train_product_model_with_mlstm(
emit_progress("生成损失曲线...", progress=95)
# 确定模型保存目录(支持多店铺)
if store_id:
# 为特定店铺创建子目录
store_model_dir = os.path.join(model_dir, 'mlstm', store_id)
os.makedirs(store_model_dir, exist_ok=True)
loss_curve_filename = f"{product_id}_mlstm_{version}_loss_curve.png"
loss_curve_path = os.path.join(store_model_dir, loss_curve_filename)
else:
# 全局模型保存在global目录
global_model_dir = os.path.join(model_dir, 'mlstm', 'global')
os.makedirs(global_model_dir, exist_ok=True)
loss_curve_filename = f"{product_id}_mlstm_{version}_global_loss_curve.png"
loss_curve_path = os.path.join(global_model_dir, loss_curve_filename)
# 确定模型保存目录
loss_curve_filename = f"{model_identifier}_mlstm_{version}_loss_curve.png"
loss_curve_path = os.path.join(model_dir, loss_curve_filename)
# 绘制损失曲线并保存到模型目录
plt.figure(figsize=(10, 6))