MADlib
1.1 A newer version is available
User Documentation
|
SQL functions for elastic net regularization. More...
Go to the source code of this file.
Functions | |
void | elastic_net_train (text tbl_source, text tbl_result, text col_dep_var, text col_ind_var, text regress_family, float8 alpha, float8 lambda_value, boolean standardize, text grouping_col, text optimizer, text optimizer_params, text excluded, integer max_iter, float8 tolerance) |
Interface for elastic net. More... | |
text | elastic_net_train () |
Help function, to print out the supported families. | |
text | elastic_net_train (text family_or_optimizer) |
Help function, to print out the supported optimizer for a family or print out the parameter list for an optimizer. More... | |
void | elastic_net_predict (text tbl_model, text tbl_new_source, text col_id, text tbl_predict) |
Prediction and put the result in a table can be used together with General-CV. More... | |
float8 | elastic_net_predict (text regress_family, float8[] coefficients, float8 intercept, float8[] ind_var) |
Prediction use learned coefficients for a given example. More... | |
float8 | elastic_net_gaussian_predict (float8[] coefficients, float8 intercept, float8[] ind_var) |
Prediction for linear models use learned coefficients for a given example. More... | |
boolean | elastic_net_binomial_predict (float8[] coefficients, float8 intercept, float8[] ind_var) |
Prediction for logistic models use learned coefficients for a given example. More... | |
float8 | elastic_net_binomial_prob (float8[] coefficients, float8 intercept, float8[] ind_var) |
Compute the probability of belonging to the True class for a given observation. More... | |
Definition in file elastic_net.sql_in.
boolean elastic_net_binomial_predict | ( | float8[] | coefficients, |
float8 | intercept, | ||
float8[] | ind_var | ||
) |
coefficients | Logistic fitting coefficients |
intercept | Logistic fitting intercept |
ind_var | Features (independent variables) |
returns a boolean value
Definition at line 750 of file elastic_net.sql_in.
float8 elastic_net_binomial_prob | ( | float8[] | coefficients, |
float8 | intercept, | ||
float8[] | ind_var | ||
) |
coefficients | Logistic fitting coefficients |
intercept | Logistic fitting intercept |
ind_var | Features (independent variables) |
returns a double value, which is the probability of this data point being True class
Definition at line 768 of file elastic_net.sql_in.
float8 elastic_net_gaussian_predict | ( | float8[] | coefficients, |
float8 | intercept, | ||
float8[] | ind_var | ||
) |
coefficients | Linear fitting coefficients |
intercept | Linear fitting intercept |
ind_var | Features (independent variables) |
returns a double value
Definition at line 732 of file elastic_net.sql_in.
void elastic_net_predict | ( | text | tbl_model, |
text | tbl_new_source, | ||
text | col_id, | ||
text | tbl_predict | ||
) |
tbl_model | The result from elastic_net_train |
tbl_new_source | Data table |
col_id | Unique ID associated with each row |
tbl_predict | Prediction result |
Definition at line 670 of file elastic_net.sql_in.
float8 elastic_net_predict | ( | text | regress_family, |
float8[] | coefficients, | ||
float8 | intercept, | ||
float8[] | ind_var | ||
) |
regress_family | model family |
coefficients | The fitting coefficients |
intercept | The fitting intercept |
ind_var | Features (independent variables) |
returns a double value. When regress_family is 'binomial' or 'logistic', this function returns 1 for True and 0 for False
Definition at line 692 of file elastic_net.sql_in.
void elastic_net_train | ( | text | tbl_source, |
text | tbl_result, | ||
text | col_dep_var, | ||
text | col_ind_var, | ||
text | regress_family, | ||
float8 | alpha, | ||
float8 | lambda_value, | ||
boolean | standardize, | ||
text | grouping_col, | ||
text | optimizer, | ||
text | optimizer_params, | ||
text | excluded, | ||
integer | max_iter, | ||
float8 | tolerance | ||
) |
tbl_source | Name of data source table |
tbl_result | Name of the table to store the results |
col_ind_var | Name of independent variable column, independent variable is an array |
col_dep_var | Name of dependent variable column |
regress_family | Response type (gaussian or binomial) |
alpha | The elastic net parameter, [0, 1] |
lambda_value | The regularization parameter |
standardize | Whether to normalize the variables (default True) |
grouping_col | List of columns on which to apply grouping (currently only a placeholder) |
optimizer | The optimization algorithm, 'fista' or 'igd'. Default is 'fista' |
optimizer_params | Parameters of the above optimizer, the format is 'arg = value, ...'. Default is NULL |
exclude | Which columns to exclude? Default is NULL (applicable only if col_ind_var is set as * or a column of array, column names as 'col1, col2, ...' if col_ind_var is '*'; element indices as '1,2,3, ...' if col_ind_var is a column of array) |
max_iter | Maximum number of iterations to run the algorithm (default value of 10000) |
tolerance | Iteration stopping criteria. Default is 1e-6 |
Definition at line 487 of file elastic_net.sql_in.
text elastic_net_train | ( | text | family_or_optimizer) |
family_or_optimizer | Response type, 'gaussian' or 'binomial', or optimizer type |
Definition at line 652 of file elastic_net.sql_in.