|
@@ -27,7 +27,7 @@
|
|
|
<div class="metric-icon">{{ metric.icon }}</div>
|
|
|
</div>
|
|
|
<div class="card-body">
|
|
|
- <div class="metric-value" :class="metric.class">{{ metric.value }}%</div>
|
|
|
+ <div class="metric-value" :class="metric.class">{{ metric.value }}</div>
|
|
|
<div class="metric-trend" :class="metric.trendClass">
|
|
|
<span>{{ metric.trendText }}</span>
|
|
|
<i :class="'trend-icon ' + metric.trendIcon"></i>
|
|
@@ -68,76 +68,76 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 数据表格 -->
|
|
|
- <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>
|
|
|
-
|
|
|
- <!-- 指标说明区 -->
|
|
|
- <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 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>-->
|
|
|
+
|
|
|
+<!-- <!– 指标说明区 –>-->
|
|
|
+<!-- <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>
|
|
|
|
|
@@ -151,6 +151,12 @@ import 'echarts/lib/component/legend'
|
|
|
|
|
|
export default {
|
|
|
name: 'ModelEvaluationDashboard',
|
|
|
+ props: {
|
|
|
+ dataInfo: {
|
|
|
+ type: Array,
|
|
|
+ default: ()=>{}
|
|
|
+ },
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
config: {
|
|
@@ -162,117 +168,7 @@ export default {
|
|
|
columnWidth: [100, 100, 100, 100, 100, 120],
|
|
|
align: ['center', 'center', 'center', 'center', 'center', 'center']
|
|
|
},
|
|
|
- dataSource: [
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_1.00.mat",
|
|
|
- "model": "BP",
|
|
|
- "snr": 1,
|
|
|
- "accuracy": 83.333333333333343,
|
|
|
- "precision": 0.88253968253968251,
|
|
|
- "recall": 0.83333333333333337,
|
|
|
- "f1_score": 0.85723095898859081,
|
|
|
- "test_time_ms": 3159.6098,
|
|
|
- "uncertainty": 0.32758402828046262
|
|
|
- },
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_100.00.mat",
|
|
|
- "model": "KNN",
|
|
|
- "snr": 100,
|
|
|
- "accuracy": 83.333333333333343,
|
|
|
- "precision": 0.83333333333333326,
|
|
|
- "recall": 0.83333333333333337,
|
|
|
- "f1_score": 0.83333333333333337,
|
|
|
- "test_time_ms": 45.331700000000005,
|
|
|
- "uncertainty": 0.35049194532946931
|
|
|
- },
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_12.00.mat",
|
|
|
- "model": "KNN",
|
|
|
- "snr": 12,
|
|
|
- "accuracy": 85,
|
|
|
- "precision": 0.89142857142857146,
|
|
|
- "recall": 0.85,
|
|
|
- "f1_score": 0.8702214930270713,
|
|
|
- "test_time_ms": 42.123,
|
|
|
- "uncertainty": 0.35362030033887409
|
|
|
- },
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_23.00.mat",
|
|
|
- "model": "KNN",
|
|
|
- "snr": 23,
|
|
|
- "accuracy": 80,
|
|
|
- "precision": 0.82222222222222219,
|
|
|
- "recall": 0.8,
|
|
|
- "f1_score": 0.810958904109589,
|
|
|
- "test_time_ms": 16.9869,
|
|
|
- "uncertainty": 0.369065022155844
|
|
|
- },
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_34.00.mat",
|
|
|
- "model": "BP",
|
|
|
- "snr": 34,
|
|
|
- "accuracy": 83.333333333333343,
|
|
|
- "precision": 0.83333333333333326,
|
|
|
- "recall": 0.83333333333333337,
|
|
|
- "f1_score": 0.83333333333333337,
|
|
|
- "test_time_ms": 97.5425,
|
|
|
- "uncertainty": 0.3756035323507031
|
|
|
- },
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_45.00.mat",
|
|
|
- "model": "ss",
|
|
|
- "snr": 45,
|
|
|
- "accuracy": 83.333333333333343,
|
|
|
- "precision": 0.83333333333333326,
|
|
|
- "recall": 0.83333333333333337,
|
|
|
- "f1_score": 0.83333333333333337,
|
|
|
- "test_time_ms": 14.5044,
|
|
|
- "uncertainty": 0.38447836662627638
|
|
|
- },
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_56.00.mat",
|
|
|
- "model": "ss",
|
|
|
- "snr": 56,
|
|
|
- "accuracy": 83.333333333333343,
|
|
|
- "precision": 0.83333333333333326,
|
|
|
- "recall": 0.83333333333333337,
|
|
|
- "f1_score": 0.83333333333333337,
|
|
|
- "test_time_ms": 8.1883,
|
|
|
- "uncertainty": 0.39321211604602763
|
|
|
- },
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_67.00.mat",
|
|
|
- "model": "BP",
|
|
|
- "snr": 67,
|
|
|
- "accuracy": 83.333333333333343,
|
|
|
- "precision": 0.83333333333333326,
|
|
|
- "recall": 0.83333333333333337,
|
|
|
- "f1_score": 0.83333333333333337,
|
|
|
- "test_time_ms": 11.1326,
|
|
|
- "uncertainty": 0.40173666709205219
|
|
|
- },
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_78.00.mat",
|
|
|
- "model": "BP",
|
|
|
- "snr": 78,
|
|
|
- "accuracy": 83.333333333333343,
|
|
|
- "precision": 0.83333333333333326,
|
|
|
- "recall": 0.83333333333333337,
|
|
|
- "f1_score": 0.83333333333333337,
|
|
|
- "test_time_ms": 7.2708,
|
|
|
- "uncertainty": 0.41032815207536966
|
|
|
- },
|
|
|
- {
|
|
|
- "filename": "fea_all_20250701172248A001_89.00.mat",
|
|
|
- "model": "BP",
|
|
|
- "snr": 89,
|
|
|
- "accuracy": 83.333333333333343,
|
|
|
- "precision": 0.83333333333333326,
|
|
|
- "recall": 0.83333333333333337,
|
|
|
- "f1_score": 0.83333333333333337,
|
|
|
- "test_time_ms": 6.7476,
|
|
|
- "uncertainty": 0.41888217650787873
|
|
|
- }
|
|
|
+ dataInfo: [
|
|
|
],
|
|
|
selectedFilename: '',
|
|
|
selectedModel: '',
|
|
@@ -281,13 +177,13 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
uniqueFilenames() {
|
|
|
- return [...new Set(this.dataSource.map(item => item.filename))]
|
|
|
+ return [...new Set(this.dataInfo.map(item => item.filename))]
|
|
|
},
|
|
|
uniqueModels() {
|
|
|
- return [...new Set(this.dataSource.map(item => item.model))]
|
|
|
+ return [...new Set(this.dataInfo.map(item => item.model))]
|
|
|
},
|
|
|
filteredData() {
|
|
|
- let filtered = this.dataSource
|
|
|
+ let filtered = this.dataInfo
|
|
|
if (this.selectedFilename) {
|
|
|
filtered = filtered.filter(item => item.filename === this.selectedFilename)
|
|
|
}
|
|
@@ -304,6 +200,8 @@ export default {
|
|
|
const maxPrecision = this.calculateMax(data, 'precision')
|
|
|
const avgRecall = this.calculateAverage(data, 'recall')
|
|
|
const avgF1Score = this.calculateAverage(data, 'f1_score')
|
|
|
+ const avgTime = this.calculateAverage(data, 'test_time_ms')
|
|
|
+
|
|
|
|
|
|
const getTrend = (current) => {
|
|
|
const lastWeek = current * (0.95 + Math.random() * 0.1)
|
|
@@ -322,25 +220,30 @@ export default {
|
|
|
{
|
|
|
name: '平均准确率',
|
|
|
icon: '🔢',
|
|
|
- value: avgAccuracy.toFixed(2),
|
|
|
+ value: avgAccuracy.toFixed(2)+'%',
|
|
|
...getTrend(avgAccuracy)
|
|
|
+ }, {
|
|
|
+ name: '平均评估时间',
|
|
|
+ icon: '🔢',
|
|
|
+ value: avgTime.toFixed(2)+'ms',
|
|
|
+ ...getTrend(avgTime)
|
|
|
},
|
|
|
{
|
|
|
name: '最高精确率',
|
|
|
icon: '🎯',
|
|
|
- value: maxPrecision.toFixed(2),
|
|
|
+ value: maxPrecision.toFixed(2)*100+'%',
|
|
|
...getTrend(maxPrecision)
|
|
|
},
|
|
|
{
|
|
|
name: '平均召回率',
|
|
|
icon: '🔄',
|
|
|
- value: avgRecall.toFixed(2),
|
|
|
+ value: avgRecall.toFixed(2)*100+'%',
|
|
|
...getTrend(avgRecall)
|
|
|
},
|
|
|
{
|
|
|
name: '平均F1分数',
|
|
|
icon: '📊',
|
|
|
- value: avgF1Score.toFixed(2),
|
|
|
+ value: avgF1Score.toFixed(2)*100+'%',
|
|
|
...getTrend(avgF1Score)
|
|
|
}
|
|
|
]
|
|
@@ -841,7 +744,7 @@ export default {
|
|
|
|
|
|
.metric-cards {
|
|
|
display: grid;
|
|
|
- grid-template-columns: repeat(4, 1fr);
|
|
|
+ grid-template-columns: repeat(5, 1fr);
|
|
|
gap: 20px;
|
|
|
margin-bottom: 20px;
|
|
|
}
|