Class for linear regression algorithm.
More...
#include <lin_reg.h>
|
| linear_regression (std::vector< std::vector< double > > points) |
| Constructor for linear regression class.
|
|
std::pair< double, double > | get_results () |
| get_results function
|
|
double | predict (double x) |
| predict function
|
|
Class for linear regression algorithm.
◆ linear_regression()
linear_regression::linear_regression |
( |
std::vector< std::vector< double > > | points | ) |
|
|
inlineexplicit |
Constructor for linear regression class.
- Parameters
-
points | 2D points that user pass to the regressor |
◆ get_results()
std::pair< double, double > linear_regression::get_results |
( |
| ) |
|
|
inline |
get_results function
- Returns
- pair<double,double> the values of a and b
◆ predict()
double linear_regression::predict |
( |
double | x | ) |
|
|
inline |
predict function
- Parameters
-
x | the value of x which we want to predict y |
- Returns
- double: the predicted value of y
The documentation for this class was generated from the following file:
- /Users/runner/work/AlgoPlus/AlgoPlus/src/machine_learning/regression/linear_regression/lin_reg.h