备注修该,异常处理
parent
d77f330713
commit
de52c2d645
|
@ -42,7 +42,7 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
<!--<span v-for="(item,index) in resMap" :key="index">{{item.name | truthFunFilter}}:{{item.val}}</span>-->
|
||||
<div v-if="meanError.length !== 0 && meanError !== []">
|
||||
<div v-if="meanError.length !== 0">
|
||||
<el-table
|
||||
:header-cell-style="headerRowClass"
|
||||
:cell-style="tableRowClassName"
|
||||
|
@ -322,7 +322,7 @@ export default {
|
|||
const totalSumOfSquares = yHat.map(val => Math.pow(val - meanY, 2)).reduce((acc, val) => acc + val, 0);
|
||||
// 计算残差平方和(SSE)
|
||||
const residualSum = y.map((val, index) => Math.pow(val - yHat[index], 2)).reduce((acc, val) => acc + val, 0);
|
||||
// 计算回归平方和(SST)
|
||||
// 总离差平方和(SST)
|
||||
const residualSumOfSquares = totalSumOfSquares + residualSum;
|
||||
// 计算 R2 决定系数
|
||||
const rSquared = 1 - (residualSum / residualSumOfSquares);
|
||||
|
|
Loading…
Reference in New Issue