aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/linear_regression/linear_regression.h
diff options
context:
space:
mode:
authorvnik <vnik@yandex-team.ru>2022-02-10 16:50:11 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:11 +0300
commit82dd4d47353b9ff187773dd251163024db870e2a (patch)
treed4d7ebc620a32552f7446d9c20f1f83f3e3dcc57 /library/cpp/linear_regression/linear_regression.h
parentcf62db3a461da3c6fdd693fb4cfada80d16031f2 (diff)
downloadydb-82dd4d47353b9ff187773dd251163024db870e2a.tar.gz
Restoring authorship annotation for <vnik@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/linear_regression/linear_regression.h')
-rw-r--r--library/cpp/linear_regression/linear_regression.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/linear_regression/linear_regression.h b/library/cpp/linear_regression/linear_regression.h
index e57de5ff6c..7e37e1b9b3 100644
--- a/library/cpp/linear_regression/linear_regression.h
+++ b/library/cpp/linear_regression/linear_regression.h
@@ -56,7 +56,7 @@ private:
TStoreType SumWeights = TStoreType();
public:
- bool Add(const double feature, const double goal, const double weight = 1.) {
+ bool Add(const double feature, const double goal, const double weight = 1.) {
SumFeatures += feature * weight;
SumSquaredFeatures += feature * feature * weight;
@@ -66,8 +66,8 @@ public:
SumProducts += goal * feature * weight;
SumWeights += weight;
-
- return true;
+
+ return true;
}
template <typename TFloatType>
@@ -140,7 +140,7 @@ private:
double Covariation = 0.;
public:
- bool Add(const double feature, const double goal, const double weight = 1.);
+ bool Add(const double feature, const double goal, const double weight = 1.);
bool Add(const double* featuresBegin, const double* featuresEnd, const double* goalsBegin);
bool Add(const double* featuresBegin, const double* featuresEnd, const double* goalsBegin, const double* weightsBegin);
@@ -188,8 +188,8 @@ public:
for (size_t featureNumber = 0; featureNumber < features.size(); ++featureNumber) {
SLRSolvers[featureNumber].Add(features[featureNumber], goal, weight);
}
-
- return true;
+
+ return true;
}
TLinearModel Solve(const double regularizationParameter = 0.1) const {
@@ -201,9 +201,9 @@ public:
}
TVector<double> coefficients(SLRSolvers.size());
- double intercept = 0.0;
+ double intercept = 0.0;
if (bestSolver) {
- bestSolver->Solve(coefficients[bestSolver - SLRSolvers.begin()], intercept, regularizationParameter);
+ bestSolver->Solve(coefficients[bestSolver - SLRSolvers.begin()], intercept, regularizationParameter);
}
TLinearModel model(std::move(coefficients), intercept);