May 2020
Intermediate to advanced
530 pages
17h 8m
English
The Shark-ML library provides the LinearModel class for representing linear regression problems. There are two trainer classes for this kind of model: the LinearRegression class, which provides analytical solutions, and the LinearSAGTrainer class, which provides a stochastic average gradient iterative method, as illustrated in the following code block:
using namespace shark;using namespace std;Data<RealVector> x;Data<RealVector> y;RegressionDataset data(x, y);LinearModel<> model;
LinearRegression trainer;trainer.train(model, data);
We can get the calculated parameters (the linear regression task solution) vector by running the following code:
auto b = model.parameterVector();
For new x inputs, ...
Read now
Unlock full access