MTX_LINEAR_REGRESSION_APPLY
This procedure applies a linear regression matrix model to data stored in a matrix.
Usage
The MTX_LINEAR_REGRESSION_APPLY stored procedure has the following syntax:
- MTX_LINEAR_REGRESSION_APPLY(modelName,predictorsMatrixName,predictedMatrixName)
- Parameters
- modelName
- The name of the created model.
- predictorsMatrixName
- The name of the matrix containing the predictors.
- predictedMatrixName
- The name of the matrix containing predicted values.
Details
This procedure applies the linear regression model built with the MTX_LINEAR_REGRESSION procedure to the provided data. Input data should be provided as Database Matrix Objects with observations provided in rows, and predictors in columns. The matrix of predicted values may contain multiple columns, that is, multiple predicted values.
Examples
call nzm..shape('1,2,3,4,5,6,7,8,9',100,10,'LR_EXAMPLE');
call nzm..shape('9,8,7,6,5,4,3,2,1',10,1,'LR_EXAMPLE_TRUE_COEFFS');
call nzm..gemm('LR_EXAMPLE','LR_EXAMPLE_TRUE_COEFFS',
'LR_EXAMPLE_TRUEVAL');
call nzm..mtx_linear_regression('LR_EXAMPLE_MODEL','LR_EXAMPLE',
'LR_EXAMPLE_TRUEVAL', FALSE, FALSE, FALSE);
call nzm..mtx_linear_regression_apply('LR_EXAMPLE_MODEL',
'LR_EXAMPLE', 'LR_EXAMPLE_PREDICTED');
call nzm..subtract('LR_EXAMPLE_PREDICTED','LR_EXAMPLE_TRUEVAL',
'LR_EXAMPLE_MODEL_verif');
call nzm..red_max_abs('LR_EXAMPLE_MODEL_verif');
call nzm..delete_all_matrices();
SHAPE
-------
t
(1 row)
SHAPE
-------
t
(1 row)
GEMM
------
t
(1 row)
MTX_LINEAR_REGRESSION
-----------------------
f
(1 row)
MTX_LINEAR_REGRESSION_APPLY
-----------------------------
(1 row)
SUBTRACT
----------
t
(1 row)
RED_MAX_ABS
---------------------
1.1368683772162e-13
(1 row)
DELETE_ALL_MATRICES
---------------------
t
(1 row)