aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/linear_regression/linear_regression_ut.cpp
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:23 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:23 +0300
commit706b83ed7de5a473436620367af31fc0ceecde07 (patch)
tree103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/linear_regression/linear_regression_ut.cpp
parent918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff)
downloadydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/linear_regression/linear_regression_ut.cpp')
-rw-r--r--library/cpp/linear_regression/linear_regression_ut.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/linear_regression/linear_regression_ut.cpp b/library/cpp/linear_regression/linear_regression_ut.cpp
index e71a16b67a..6915c3821d 100644
--- a/library/cpp/linear_regression/linear_regression_ut.cpp
+++ b/library/cpp/linear_regression/linear_regression_ut.cpp
@@ -15,8 +15,8 @@ namespace {
Y_UNIT_TEST_SUITE(TLinearRegressionTest) {
Y_UNIT_TEST(MeanAndDeviationTest) {
- TVector<double> arguments;
- TVector<double> weights;
+ TVector<double> arguments;
+ TVector<double> weights;
const size_t argumentsCount = 100;
for (size_t i = 0; i < argumentsCount; ++i) {
@@ -78,9 +78,9 @@ Y_UNIT_TEST_SUITE(TLinearRegressionTest) {
}
Y_UNIT_TEST(CovariationTest) {
- TVector<double> firstValues;
- TVector<double> secondValues;
- TVector<double> weights;
+ TVector<double> firstValues;
+ TVector<double> secondValues;
+ TVector<double> weights;
const size_t argumentsCount = 100;
for (size_t i = 0; i < argumentsCount; ++i) {
@@ -130,9 +130,9 @@ Y_UNIT_TEST_SUITE(TLinearRegressionTest) {
template <typename TSLRSolverType>
void SLRTest() {
- TVector<double> arguments;
- TVector<double> weights;
- TVector<double> goals;
+ TVector<double> arguments;
+ TVector<double> weights;
+ TVector<double> goals;
const double factor = 2.;
const double intercept = 105.;
@@ -194,18 +194,18 @@ Y_UNIT_TEST_SUITE(TLinearRegressionTest) {
const size_t instancesCount = 10000;
const double randomError = 0.01;
- TVector<double> coefficients;
+ TVector<double> coefficients;
for (size_t featureNumber = 0; featureNumber < featuresCount; ++featureNumber) {
coefficients.push_back(featureNumber);
}
const double intercept = 10;
TVector<TVector<double>> featuresMatrix;
- TVector<double> goals;
- TVector<double> weights;
+ TVector<double> goals;
+ TVector<double> weights;
for (size_t instanceNumber = 0; instanceNumber < instancesCount; ++instanceNumber) {
- TVector<double> features;
+ TVector<double> features;
for (size_t featureNumber = 0; featureNumber < featuresCount; ++featureNumber) {
features.push_back(RandomNumber<double>());
}
@@ -240,8 +240,8 @@ Y_UNIT_TEST_SUITE(TLinearRegressionTest) {
}
void TransformationTest(const ETransformationType transformationType, const size_t pointsCount) {
- TVector<float> arguments;
- TVector<float> goals;
+ TVector<float> arguments;
+ TVector<float> goals;
const double regressionFactor = 10.;
const double regressionIntercept = 100;
@@ -300,8 +300,8 @@ Y_UNIT_TEST_SUITE(TLinearRegressionTest) {
}
Y_UNIT_TEST(ResetCalculatorTest) {
- TVector<double> arguments;
- TVector<double> weights;
+ TVector<double> arguments;
+ TVector<double> weights;
const double eps = 1e-10;
const size_t argumentsCount = 100;