Polynomial Regression model for fitting polynomial curves.
More...
#include <PolynomialRegression.hpp>
|
| PolynomialRegression (int degree, double regularizationParameter=0.0) |
| Constructor initializing the polynomial degree. More...
|
|
void | train (const std::vector< double > &x, const std::vector< double > &y) |
| Train the model using features and target values. More...
|
|
double | predict (double x) const |
| Predicts the output for a given input value. More...
|
|
std::vector< double > | getCoefficients () const |
| Get the coefficients of the fitted polynomial. More...
|
|
Polynomial Regression model for fitting polynomial curves.
◆ PolynomialRegression()
PolynomialRegression::PolynomialRegression |
( |
int |
degree, |
|
|
double |
regularizationParameter = 0.0 |
|
) |
| |
|
inline |
Constructor initializing the polynomial degree.
- Parameters
-
degree | Degree of the polynomial. |
regularizationParameter | Regularization strength (default is 0.0, no regularization). |
◆ getCoefficients()
std::vector<double> PolynomialRegression::getCoefficients |
( |
| ) |
const |
|
inline |
Get the coefficients of the fitted polynomial.
- Returns
- Vector of coefficients.
◆ predict()
double PolynomialRegression::predict |
( |
double |
x | ) |
const |
|
inline |
Predicts the output for a given input value.
- Parameters
-
- Returns
- Predicted value.
◆ train()
void PolynomialRegression::train |
( |
const std::vector< double > & |
x, |
|
|
const std::vector< double > & |
y |
|
) |
| |
|
inline |
Train the model using features and target values.
- Parameters
-
x | Feature vector. |
y | Target vector. |
The documentation for this class was generated from the following file: