MADlib
1.0 A newer version is available
User Documentation
|
SQL functions for multinomial logistic regression. More...
Go to the source code of this file.
Functions | |
mlogregr_result | mlogregr (varchar source, varchar depvar, varchar indepvar, integer maxnumiterations=20, varchar optimizer="irls", float8 precision=0.0001, integer ref_category) |
Compute logistic-regression coefficients and diagnostic statistics. More... | |
Definition in file multilogistic.sql_in.
mlogregr_result mlogregr | ( | varchar | source, |
varchar | depvar, | ||
varchar | indepvar, | ||
integer | maxnumiterations = 20 , |
||
varchar | optimizer = "irls" , |
||
float8 | precision = 0.0001 , |
||
integer | ref_category | ||
) |
To include an intercept in the model, set one coordinate in the independentVariables
array to 1.
source | Name of the source relation containing the training data |
depvar | Name of the dependent column (of type INTEGER < numcategories) |
indepvar | Name of the independent column (of type DOUBLE PRECISION[]) |
maxnumiterations | The maximum number of iterations |
optimizer | The optimizer to use ( 'irls' /'newton' for iteratively reweighted least squares) |
precision | The difference between log-likelihood values in successive iterations that should indicate convergence. Note that a non-positive value here disables the convergence criterion, and execution will only stop after \ maxNumIterations iterations. |
ref_category | The reference category specified by the user |
ref_category INTEGER
- Reference categorycoef FLOAT8[]
- Array of coefficients, \( \boldsymbol c \)log_likelihood FLOAT8
- Log-likelihood \( l(\boldsymbol c) \)std_err FLOAT8[]
- Array of standard errors, \( \mathit{se}(c_1), \dots, \mathit{se}(c_k) \)z_stats FLOAT8[]
- Array of Wald z-statistics, \( \boldsymbol z \)p_values FLOAT8[]
- Array of Wald p-values, \( \boldsymbol p \)odds_ratios FLOAT8[]
: Array of odds ratios, \( \mathit{odds}(c_1), \dots, \mathit{odds}(c_k) \)condition_no FLOAT8
- The condition number of matrix \( X^T A X \) during the iteration immediately preceding convergence (i.e., \( A \) is computed using the coefficients of the previous iteration)num_iterations INTEGER
- The number of iterations before the algorithm terminatedSELECT * FROM mlogregr('sourceName', 'dependentVariable', 'numCategories', 'independentVariables');
SELECT (mlogregr('sourceName', 'dependentVariable', 'numCategories', 'independentVariables')).coef;
SELECT coef, log_likelihood, p_values FROM mlogregr('sourceName', 'dependentVariable', 'numCategories', 'independentVariables');
Definition at line 393 of file multilogistic.sql_in.