LOGISTIC_REG
Executes logistic regression on an input table or view. The result is a logistic regression model.
Important: Before using a machine learning function, be aware that all the ongoing transactions might be committed.
Syntax
LOGISTIC_REG ( 'model_name', 'input_relation', 'response_column', 'predictor_columns' [ USING PARAMETERS[exclude_columns='col1, col2, ... coln',] [optimizer='value',] [epsilon=value, ] [max_iterations=value] [regularization= 'value',] [lambda= value] ])
Arguments
model_name |
The name of the linear regression model. You can use the resulting model for prediction with the PREDICT_LOGISTIC_REG function. Model names are case insensitive. |
input_relation |
The table or view that contains the training data for building the model. |
response_column |
The name of the column in the For the model to be valid, all values in this column must be INTEGER types with a value of either |
predictor_columns |
A comma-separated list of the columns in the For the model to be valid, all values in this column must be of type numeric. Supports the use of wildcard (*) characters in place of column names. If you use a wildcard character (*) in place of a column name, all the columns in |
Parameters
exclude_columns=col1, col2, ... coln |
(Optional) The columns from |
optimizer=value |
(Optional) The optimizer method to be used to train the model. Valid Values:
|
epsilon=value |
(Optional) Determines whether the algorithm has reached the specified accuracy result. Default Value: 0.000001 |
max_iterations=value |
(Optional) Determines the maximum number of iterations the algorithm performs before achieving the specified accuracy result. Default Value: 100 |
regularization=value |
(Optional) Determines the method of regularization. Default Value: None Valid Values:
|
lambda=value |
(Optional) The regularization parameter value. The value must be zero or positive. Default Value: 0.0 |
Privileges
To use LOGISTIC_REG, you must either be a superuser or have CREATE privileges for the schema of the output view and SELECT privileges for the input table or view. There are no privileges needed on the function itself.
See GRANT (Schema) and GRANT (Table).
Examples
This example shows how you can use the LOGISTIC_REG function.
=> SELECT LOGISTIC_REG('myLogisticRegModel', 'mtcars', 'am', 'mpg, cyl, disp, hp, drat, wt, qsec, vs, gear, carb' USING PARAMETERS exclude_columns='hp', optimizer='BFGS'); LOGISTIC_REG ---------------------------- Finished in 20 iterations (1 row)