diff --git a/src/components/rtReport/index.vue b/src/components/rtReport/index.vue index 02997b2..4bdef3c 100644 --- a/src/components/rtReport/index.vue +++ b/src/components/rtReport/index.vue @@ -42,7 +42,7 @@ -
+
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);