diff --git a/lib/src/Uncertainty/Algorithm/MetaModel/MetaModelValidation.cxx b/lib/src/Uncertainty/Algorithm/MetaModel/MetaModelValidation.cxx index e7087a74b40..2079ceb114f 100644 --- a/lib/src/Uncertainty/Algorithm/MetaModel/MetaModelValidation.cxx +++ b/lib/src/Uncertainty/Algorithm/MetaModel/MetaModelValidation.cxx @@ -109,7 +109,7 @@ void MetaModelValidation::initialize() const // From this, it derives also the predictive factor i.e. 1 - RSS/SS, // RSS = Residual Sum of Squares, SS = Sum of Squares residual_ = outputSample_ - metaModelPredictions_; - const Point meanSquaredError_(residual_.computeRawMoment(2)); + meanSquaredError_ = residual_.computeRawMoment(2); r2Score_ = ComputeR2Score(meanSquaredError_, outputSample_); } @@ -231,9 +231,7 @@ void MetaModelValidation::load(Advocate & adv) adv.loadAttribute( "residual_", residual_ ); adv.loadAttribute( "r2Score_", r2Score_ ); if (adv.hasAttribute("meanSquaredError_")) - { adv.loadAttribute( "meanSquaredError_", meanSquaredError_ ); - } else { const UnsignedInteger outputDimension = outputSample_.getDimension(); @@ -242,9 +240,7 @@ void MetaModelValidation::load(Advocate & adv) << " but the dimension of the output sample is " << outputDimension; const Point sampleVariance(outputSample_.computeCentralMoment(2)); for (UnsignedInteger j = 0; j < outputDimension; ++ j) - { meanSquaredError_[j] = sampleVariance[j] * (1.0 - r2Score_[j]); - } } }