Explorar o código

//细节调整

wyj0522 hai 4 días
pai
achega
1d21a01b33
Modificáronse 2 ficheiros con 27 adicións e 92 borrados
  1. 22 88
      fdapfe-ui/src/views/form.vue
  2. 5 4
      fdapfe-ui/src/views/index.vue

+ 22 - 88
fdapfe-ui/src/views/form.vue

@@ -67,77 +67,6 @@
         </dv-border-box-13>
       </div>
     </div>
-
-<!--    &lt;!&ndash; 数据表格 &ndash;&gt;-->
-<!--    <div class="data-table-container">-->
-<!--      <h3 class="table-title" style="color: #3375F6">模型评估详细数据</h3>-->
-<!--      <div class="table-wrapper">-->
-<!--        <dv-scroll-board class="data-table" :config="config" style="width:100%;height:100%" />-->
-<!--      </div>-->
-<!--    </div>-->
-
-<!--    &lt;!&ndash; 指标说明区 &ndash;&gt;-->
-<!--    <div class="metric-explanation">-->
-<!--      <h3>精度评估指标说明</h3>-->
-<!--      <div class="explanation-table">-->
-<!--        <table>-->
-<!--          <thead>-->
-<!--          <tr>-->
-<!--            <th>指标名称</th>-->
-<!--            <th>公式</th>-->
-<!--            <th>说明</th>-->
-<!--          </tr>-->
-<!--          </thead>-->
-<!--          <tbody>-->
-<!--          <tr>-->
-<!--            <td>准确率 (Accuracy)</td>-->
-<!--            <td>(TP+TN)/(TP+TN+FP+FN)</td>-->
-<!--            <td>正确预测的样本占总样本的比例</td>-->
-<!--          </tr>-->
-<!--          <tr>-->
-<!--            <td>精确率 (Precision)</td>-->
-<!--            <td>TP/(TP+FP)</td>-->
-<!--            <td>正类预测中实际为正类的比例</td>-->
-<!--          </tr>-->
-<!--          <tr>-->
-<!--            <td>召回率 (Recall)</td>-->
-<!--            <td>TP/(TP+FN)</td>-->
-<!--            <td>实际正类中被正确预测的比例</td>-->
-<!--          </tr>-->
-<!--          <tr>-->
-<!--            <td>特异度 (Specificity)</td>-->
-<!--            <td>TN/(TN+FP)</td>-->
-<!--            <td>实际负类中被正确预测的比例</td>-->
-<!--          </tr>-->
-<!--          <tr>-->
-<!--            <td>F1分数 (F-measure)</td>-->
-<!--            <td>2*(Precision*Recall)/(Precision+Recall)</td>-->
-<!--            <td>精确率和召回率的加权平均</td>-->
-<!--          </tr>-->
-<!--          <tr>-->
-<!--            <td>ROC曲线</td>-->
-<!--            <td>横坐标: FPR, 纵坐标: TPR</td>-->
-<!--            <td>45度线为参照线,曲线偏离越远结果越准确</td>-->
-<!--          </tr>-->
-<!--          <tr>-->
-<!--            <td>AUC</td>-->
-<!--            <td>ROC曲线下面积</td>-->
-<!--            <td>参考线面积为0.5,AUC越大分类效果越好</td>-->
-<!--          </tr>-->
-<!--          <tr>-->
-<!--            <td>基尼系数</td>-->
-<!--            <td>2*AUC-1</td>-->
-<!--            <td>评估模型区分不同类别的能力</td>-->
-<!--          </tr>-->
-<!--          <tr>-->
-<!--            <td>K-S值</td>-->
-<!--            <td>max(TPR-FPR)</td>-->
-<!--            <td>评判模型区分正负样本的能力,一般0.3以上效果较好</td>-->
-<!--          </tr>-->
-<!--          </tbody>-->
-<!--        </table>-->
-<!--      </div>-->
-<!--    </div>-->
   </div>
 </template>
 
@@ -154,7 +83,7 @@ export default {
   props: {
     dataInfo: {
       type: Array,
-      default: ()=>{}
+      default: ()=>[]
     },
   },
   data() {
@@ -168,8 +97,6 @@ export default {
         columnWidth: [100, 100, 100, 100, 100, 120],
         align: ['center', 'center', 'center', 'center', 'center', 'center']
       },
-      dataInfo: [
-      ],
       selectedFilename: '',
       selectedModel: '',
       currentTime: '',
@@ -272,13 +199,14 @@ export default {
       return data.reduce((max, item) => Math.max(max, item[key]), 0)
     },
     initCharts() {
-      // 准确率与不确定性分析图表
+      // 准确率与不确定性分析图表 - 修改部分
       const accuracyUncertaintyChart = echarts.init(this.$refs.accuracyUncertaintyChart)
       const chartData = this.filteredData.sort((a, b) => a.snr - b.snr)
 
       const snrValues = chartData.map(item => item.snr)
       const accuracyValues = chartData.map(item => item.accuracy)
-      const uncertaintyValues = chartData.map(item => item.uncertainty)
+      // 1. 将不确定性值转换为百分比(如果原始值是小数)
+      const uncertaintyValues = chartData.map(item => item.uncertainty * 100)
 
       const accuracyUncertaintyOptions = {
         backgroundColor: '#0C0E24',
@@ -289,10 +217,18 @@ export default {
         },
         tooltip: {
           trigger: 'axis',
-          axisPointer: { type: 'cross' }
+          axisPointer: { type: 'cross' },
+          // 2. 提示框显示百分比
+          formatter: function(params) {
+            let result = `${params[0].name} SNR: ${params[0].value[0]}`;
+            params.forEach(item => {
+              result += `<br/>${item.seriesName}: ${item.value[1].toFixed(2)}%`;
+            });
+            return result;
+          }
         },
         legend: {
-          data: ['准确率(%)', '不确定性'],
+          data: ['准确率(%)', '不确定性(%)'],  // 3. 图例添加百分号
           textStyle: { color: '#00f5ff' },
           top: '10%'
         },
@@ -314,18 +250,18 @@ export default {
           {
             type: 'value',
             name: '准确率 (%)',
-            min: 75,
-            max: 90,
+            min: 50,
+            max: 100,
             axisLine: { color: '#00f5ff' },
             axisLabel: { color: '#00f5ff', formatter: '{value}%' }
           },
           {
             type: 'value',
-            name: '不确定性',
-            min: 0.3,
-            max: 0.45,
+            name: '不确定性 (%)',  // 4. Y轴名称添加百分号
+            min: 0,  // 5. 调整最小值(根据实际数据范围)
+            max: 100,  // 6. 最大值设为100(百分比)
             axisLine: { color: '#ff9800' },
-            axisLabel: { color: '#ff9800' },
+            axisLabel: { color: '#ff9800', formatter: '{value}%'},  // 7. 标签显示百分号
             position: 'right'
           }
         ],
@@ -347,11 +283,11 @@ export default {
             yAxisIndex: 0
           },
           {
-            name: '不确定性',
+            name: '不确定性(%)',  // 8. 系列名称添加百分号
             type: 'line',
             symbol: 'diamond',
             symbolSize: 8,
-            data: snrValues.map((snr, i) => [snr, uncertaintyValues[i]]),
+            data: snrValues.map((snr, i) => [snr, uncertaintyValues[i]]),  // 使用转换后的百分比数据
             itemStyle: { color: '#ff9800' },
             lineStyle: { width: 2, color: '#ff9800' },
             areaStyle: {
@@ -673,8 +609,6 @@ export default {
 }
 </script>
 
-
-
 <style scoped>
 .dashboard-container {
   width: 100%;

+ 5 - 4
fdapfe-ui/src/views/index.vue

@@ -231,6 +231,7 @@
     <el-dialog
       fullscreen
       title="综合比对结果"
+      v-if="compareDialogVisible"
       :visible.sync="compareDialogVisible"
       width="80%"
       :before-close="handleCompareDialogClose"
@@ -323,7 +324,7 @@ export default {
         })
         return
       }
-
+      console.log('this.ids',this.ids)
       try {
         // 合并所有选中行的resultText数据
         const allResults = []
@@ -333,7 +334,7 @@ export default {
             try {
               const resultItems = JSON.parse(row.resultText)
               allResults.push(...resultItems)
-              console.log('allResults',allResults)
+
             } catch (e) {
               this.$message({
                 message: `解析数据失败:${row.name}`,
@@ -342,7 +343,7 @@ export default {
             }
           }
         })
-
+        console.log('allResults',allResults)
         if (allResults.length === 0) {
           this.$message({
             message: '没有可比对的数据',
@@ -352,7 +353,7 @@ export default {
         }
 
         // 去重处理(如果需要)
-        const uniqueResults = this.removeDuplicates(allResults)
+        const uniqueResults = allResults
 
         // 保存比对结果并显示对话框
         this.compareResult = uniqueResults