Skip to content
Snippets Groups Projects
Commit 5333393d authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Fix os operator

parent c7237cde
No related branches found
No related tags found
No related merge requests found
......@@ -76,9 +76,10 @@ simox::math::operator<<(std::ostream& os, const LinearRegression3D& r)
{
os << ", ";
}
os << r.coefficients(row, 0)
<< " + " << r.coefficients(row, 1) << " * x_" << row
<< " = y_" << row;
os << "y_" << row
<< " = " << r.coefficients(row, 0)
<< " + " << r.coefficients(row, 1) << " * x"
;
}
os << " ]";
return os;
......
......@@ -7,8 +7,8 @@ namespace simox::math
{
/**
* @brief A linear regression model of the form a + b * x = y,
* or per dimension, a_i + b_i * x = y_i.
* @brief A linear regression model of the form y = a + b * x,
* or per dimension, y_i = a_i + b_i * x.
*
* - x is the scalar input variable (e.g. time)
* - y is 3D vector output variable (e.g. position)
......
......@@ -86,8 +86,6 @@ BOOST_AUTO_TEST_CASE(test_linear_regression_3d_fit_and_predict_with_input_offset
// Coefficients are different now, but prediction should be the same.
// Predict
BOOST_CHECK_LE((regression.predict(xs[0]) - ys[0]).norm(), prec);
BOOST_CHECK_LE((regression.predict(xs[1]) - ys[1]).norm(), prec);
BOOST_CHECK_LE((regression.predict(xs[2]) - ys[2]).norm(), prec);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment