AlgoPlus v0.1.0
Loading...
Searching...
No Matches
linear_regression Class Reference

Class for linear regression algorithm. More...

#include <lin_reg.h>

Public Member Functions

 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
 

Detailed Description

Class for linear regression algorithm.

Constructor & Destructor Documentation

◆ linear_regression()

linear_regression::linear_regression ( std::vector< std::vector< double > > points)
inlineexplicit

Constructor for linear regression class.

Parameters
points2D points that user pass to the regressor

Member Function Documentation

◆ 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
xthe 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: