mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Added a member function to get the line intercept from running_gradient.
This commit is contained in:
parent
3165ff2892
commit
4f367471ae
@ -72,6 +72,18 @@ namespace dlib
|
||||
return w(0);
|
||||
}
|
||||
|
||||
double intercept (
|
||||
) const
|
||||
{
|
||||
// make sure requires clause is not broken
|
||||
DLIB_ASSERT(current_n() > 0,
|
||||
"\t double running_gradient::intercept()"
|
||||
<< "\n\t You must add more values into this object before calling this function."
|
||||
<< "\n\t this: " << this
|
||||
);
|
||||
|
||||
return w(1);
|
||||
}
|
||||
double standard_error (
|
||||
) const
|
||||
{
|
||||
|
@ -65,6 +65,19 @@ namespace dlib
|
||||
of this line.
|
||||
!*/
|
||||
|
||||
double intercept (
|
||||
) const;
|
||||
/*!
|
||||
requires
|
||||
- current_n() > 0
|
||||
ensures
|
||||
- This class fits a line to the time series data given to add(). This
|
||||
function returns the intercept of that line while gradient() returns the
|
||||
slope of that line. This means that, for example, the next point that
|
||||
add() will see, as predicted by this best fit line, is the value
|
||||
intercept() + current_n()*gradient().
|
||||
!*/
|
||||
|
||||
double standard_error (
|
||||
) const;
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user