diff options
author | vnik <vnik@yandex-team.ru> | 2022-02-10 16:50:11 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:11 +0300 |
commit | 82dd4d47353b9ff187773dd251163024db870e2a (patch) | |
tree | d4d7ebc620a32552f7446d9c20f1f83f3e3dcc57 /library/cpp/linear_regression/linear_regression.cpp | |
parent | cf62db3a461da3c6fdd693fb4cfada80d16031f2 (diff) | |
download | ydb-82dd4d47353b9ff187773dd251163024db870e2a.tar.gz |
Restoring authorship annotation for <vnik@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/linear_regression/linear_regression.cpp')
-rw-r--r-- | library/cpp/linear_regression/linear_regression.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/linear_regression/linear_regression.cpp b/library/cpp/linear_regression/linear_regression.cpp index 150f9d214e..e19c4a8736 100644 --- a/library/cpp/linear_regression/linear_regression.cpp +++ b/library/cpp/linear_regression/linear_regression.cpp @@ -41,8 +41,8 @@ bool TFastLinearRegressionSolver::Add(const TVector<double>& features, const dou *olsVectorElement += weightedGoal; SumSquaredGoals += goal * goal * weight; - - return true; + + return true; } bool TLinearRegressionSolver::Add(const TVector<double>& features, const double goal, const double weight) { @@ -59,7 +59,7 @@ bool TLinearRegressionSolver::Add(const TVector<double>& features, const double SumWeights += weight; if (!SumWeights.Get()) { - return false; + return false; } for (size_t featureNumber = 0; featureNumber < featuresCount; ++featureNumber) { @@ -109,8 +109,8 @@ bool TLinearRegressionSolver::Add(const TVector<double>& features, const double const double oldGoalsMean = GoalsMean; GoalsMean += weight * (goal - GoalsMean) / SumWeights.Get(); GoalsDeviation += weight * (goal - oldGoalsMean) * (goal - GoalsMean); - - return true; + + return true; } TLinearModel TFastLinearRegressionSolver::Solve() const { @@ -147,10 +147,10 @@ double TLinearRegressionSolver::SumSquaredErrors() const { return ::SumSquaredErrors(LinearizedOLSMatrix, OLSVector, coefficients, GoalsDeviation); } -bool TSLRSolver::Add(const double feature, const double goal, const double weight) { +bool TSLRSolver::Add(const double feature, const double goal, const double weight) { SumWeights += weight; if (!SumWeights.Get()) { - return false; + return false; } const double weightedFeatureDiff = weight * (feature - FeaturesMean); @@ -163,8 +163,8 @@ bool TSLRSolver::Add(const double feature, const double goal, const double weigh GoalsDeviation += weightedGoalDiff * (goal - GoalsMean); Covariation += weightedFeatureDiff * (goal - GoalsMean); - - return true; + + return true; } bool TSLRSolver::Add(const double* featuresBegin, |