Developer Guide for Intel® Data Analytics Acceleration Library 2019 Update 5
Linear regression is a method for modeling the relationship between a dependent variable (which may be a vector) and one or more explanatory variables by fitting linear equations to observed data. The case of one explanatory variable is called Simple Linear Regression. For several explanatory variables the method is called Multiple Linear Regression.
Let (x1,…,xp) be a vector of input variables and y=(y1,…,yk) be the response. For each j=1,…,k, the linear regression model has the format [Hastie2009]:
y j =β0j+ β1jx1+...+ βpjxp
Here xi, i=1,...,p, are referred to as independent variables, and yj are referred to as dependent variables or responses.
The linear regression is multiple if the number of input variables p > 1.
Training Stage
Let (x11,...,x1p,y1 ),…,(xn1,...,xnp,yn ) be a set of training data, n >> p. The matrix X of size n x p contains observations xij,i=1,...,n,j=1,….,p, of independent variables.
To estimate the coefficients (β0j,...,βpj) one these methods can be used:
Prediction Stage
Linear regression based prediction is done for input vector (x1,…,xp) using the equation yj=β0j+ β1jx1+...+βpjxp for each j=1,…,k.
If you already have a set of pre-calculated coefficients {βij}, you can use the Model Builder class to get a trained Intel DAAL Linear Regression model with these coefficients. After the model is built, you can proceed to the prediction stage.
The set of pre-calculated coefficients should contain K vectors βi, where K is the number of responses. Each vector βi should be either of dimension p+1 (for vectors that include an intercept) or of dimension p otherwise, where p is the number of features. Note that the intercept value is stored as the zeroth component of βi.
For general information on using the Model Builder class, see Training and Prediction. For details on using the Model Builder class for Linear Regression, see Usage of training alternative.