diff options
| author | yazevnul <[email protected]> | 2022-02-10 16:46:48 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:48 +0300 | 
| commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
| tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/linear_regression | |
| parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/linear_regression')
| -rw-r--r-- | library/cpp/linear_regression/linear_regression.h | 10 | ||||
| -rw-r--r-- | library/cpp/linear_regression/linear_regression_ut.cpp | 30 | ||||
| -rw-r--r-- | library/cpp/linear_regression/welford.h | 6 | 
3 files changed, 23 insertions, 23 deletions
| diff --git a/library/cpp/linear_regression/linear_regression.h b/library/cpp/linear_regression/linear_regression.h index 20b3ae1e539..e57de5ff6cc 100644 --- a/library/cpp/linear_regression/linear_regression.h +++ b/library/cpp/linear_regression/linear_regression.h @@ -146,12 +146,12 @@ public:      bool Add(const double* featuresBegin, const double* featuresEnd, const double* goalsBegin, const double* weightsBegin);      bool Add(const TVector<double>& features, const TVector<double>& goals) { -        Y_ASSERT(features.size() == goals.size());  +        Y_ASSERT(features.size() == goals.size());          return Add(features.data(), features.data() + features.size(), goals.data());      }      bool Add(const TVector<double>& features, const TVector<double>& goals, const TVector<double>& weights) { -        Y_ASSERT(features.size() == goals.size() && features.size() == weights.size());  +        Y_ASSERT(features.size() == goals.size() && features.size() == weights.size());          return Add(features.data(), features.data() + features.size(), goals.data(), weights.data());      } @@ -239,7 +239,7 @@ struct TTransformationParameters {      double FeatureOffset = 0.;      double FeatureNormalizer = 1.; -    Y_SAVELOAD_DEFINE(RegressionFactor,  +    Y_SAVELOAD_DEFINE(RegressionFactor,                        RegressionIntercept,                        FeatureOffset,                        FeatureNormalizer); @@ -251,7 +251,7 @@ private:      TTransformationParameters TransformationParameters;  public: -    Y_SAVELOAD_DEFINE(TransformationType, TransformationParameters);  +    Y_SAVELOAD_DEFINE(TransformationType, TransformationParameters);      TFeaturesTransformer() = default; @@ -273,7 +273,7 @@ public:                  return TransformationParameters.RegressionIntercept + TransformationParameters.RegressionFactor * transformedValue;              }          } -        Y_ASSERT(0);  +        Y_ASSERT(0);          return 0.;      }  }; diff --git a/library/cpp/linear_regression/linear_regression_ut.cpp b/library/cpp/linear_regression/linear_regression_ut.cpp index 991a95c0d09..e71a16b67a1 100644 --- a/library/cpp/linear_regression/linear_regression_ut.cpp +++ b/library/cpp/linear_regression/linear_regression_ut.cpp @@ -13,8 +13,8 @@ namespace {      }  } -Y_UNIT_TEST_SUITE(TLinearRegressionTest) {  -    Y_UNIT_TEST(MeanAndDeviationTest) {  +Y_UNIT_TEST_SUITE(TLinearRegressionTest) { +    Y_UNIT_TEST(MeanAndDeviationTest) {          TVector<double> arguments;          TVector<double> weights; @@ -77,7 +77,7 @@ Y_UNIT_TEST_SUITE(TLinearRegressionTest) {          ValueIsCorrect(deviationCalculator.GetDeviation(), checkRemovingDeviationCalculator.GetDeviation(), 1e-5);      } -    Y_UNIT_TEST(CovariationTest) {  +    Y_UNIT_TEST(CovariationTest) {          TVector<double> firstValues;          TVector<double> secondValues;          TVector<double> weights; @@ -176,15 +176,15 @@ Y_UNIT_TEST_SUITE(TLinearRegressionTest) {          }      } -    Y_UNIT_TEST(FastSLRTest) {  +    Y_UNIT_TEST(FastSLRTest) {          SLRTest<TFastSLRSolver>();      } -    Y_UNIT_TEST(KahanSLRTest) {  +    Y_UNIT_TEST(KahanSLRTest) {          SLRTest<TKahanSLRSolver>();      } -    Y_UNIT_TEST(SLRTest) {  +    Y_UNIT_TEST(SLRTest) {          SLRTest<TSLRSolver>();      } @@ -231,11 +231,11 @@ Y_UNIT_TEST_SUITE(TLinearRegressionTest) {          UNIT_ASSERT_DOUBLES_EQUAL(lrSolver.SumSquaredErrors(), expectedSumSquaredErrors, expectedSumSquaredErrors * 0.01);      } -    Y_UNIT_TEST(FastLRTest) {  +    Y_UNIT_TEST(FastLRTest) {          LinearRegressionTest<TFastLinearRegressionSolver>();      } -    Y_UNIT_TEST(LRTest) {  +    Y_UNIT_TEST(LRTest) {          LinearRegressionTest<TLinearRegressionSolver>();      } @@ -275,31 +275,31 @@ Y_UNIT_TEST_SUITE(TLinearRegressionTest) {          UNIT_ASSERT_DOUBLES_EQUAL(rmse, 0., 1e-3);      } -    Y_UNIT_TEST(SigmaTest100) {  +    Y_UNIT_TEST(SigmaTest100) {          TransformationTest(ETransformationType::TT_SIGMA, 100);      } -    Y_UNIT_TEST(SigmaTest1000) {  +    Y_UNIT_TEST(SigmaTest1000) {          TransformationTest(ETransformationType::TT_SIGMA, 1000);      } -    Y_UNIT_TEST(SigmaTest10000) {  +    Y_UNIT_TEST(SigmaTest10000) {          TransformationTest(ETransformationType::TT_SIGMA, 10000);      } -    Y_UNIT_TEST(SigmaTest100000) {  +    Y_UNIT_TEST(SigmaTest100000) {          TransformationTest(ETransformationType::TT_SIGMA, 100000);      } -    Y_UNIT_TEST(SigmaTest1000000) {  +    Y_UNIT_TEST(SigmaTest1000000) {          TransformationTest(ETransformationType::TT_SIGMA, 1000000);      } -    Y_UNIT_TEST(SigmaTest10000000) {  +    Y_UNIT_TEST(SigmaTest10000000) {          TransformationTest(ETransformationType::TT_SIGMA, 10000000);      } -    Y_UNIT_TEST(ResetCalculatorTest) {  +    Y_UNIT_TEST(ResetCalculatorTest) {          TVector<double> arguments;          TVector<double> weights;          const double eps = 1e-10; diff --git a/library/cpp/linear_regression/welford.h b/library/cpp/linear_regression/welford.h index a39800974c0..ee865d66937 100644 --- a/library/cpp/linear_regression/welford.h +++ b/library/cpp/linear_regression/welford.h @@ -11,7 +11,7 @@ private:      TKahanAccumulator<double> SumWeights;  public: -    Y_SAVELOAD_DEFINE(Mean, SumWeights);  +    Y_SAVELOAD_DEFINE(Mean, SumWeights);      void Multiply(const double value);      void Add(const double value, const double weight = 1.); @@ -40,7 +40,7 @@ private:      TKahanAccumulator<double> SumWeights;  public: -    Y_SAVELOAD_DEFINE(Covariation, FirstValueMean, SecondValueMean, SumWeights);  +    Y_SAVELOAD_DEFINE(Covariation, FirstValueMean, SecondValueMean, SumWeights);      void Add(const double firstValue, const double secondValue, const double weight = 1.);      void Remove(const double firstValue, const double secondValue, const double weight = 1.); @@ -62,7 +62,7 @@ private:      TMeanCalculator MeanCalculator;  public: -    Y_SAVELOAD_DEFINE(Deviation, MeanCalculator);  +    Y_SAVELOAD_DEFINE(Deviation, MeanCalculator);      void Add(const double value, const double weight = 1.);      void Remove(const double value, const double weight = 1.); | 
