User Documentation
 All Files Functions Groups
elastic_net.sql_in File Reference

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...
 

Detailed Description

Date
July 2012
See Also
For a brief introduction to elastic net, see the module description grp_lasso.

Definition in file elastic_net.sql_in.

Function Documentation

boolean elastic_net_binomial_predict ( float8[]  coefficients,
float8  intercept,
float8[]  ind_var 
)
Parameters
coefficientsLogistic fitting coefficients
interceptLogistic fitting intercept
ind_varFeatures (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 
)
Parameters
coefficientsLogistic fitting coefficients
interceptLogistic fitting intercept
ind_varFeatures (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 
)
Parameters
coefficientsLinear fitting coefficients
interceptLinear fitting intercept
ind_varFeatures (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 
)
Parameters
tbl_modelThe result from elastic_net_train
tbl_new_sourceData table
col_idUnique ID associated with each row
tbl_predictPrediction 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 
)
Parameters
regress_familymodel family
coefficientsThe fitting coefficients
interceptThe fitting intercept
ind_varFeatures (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 
)
Parameters
tbl_sourceName of data source table
tbl_resultName of the table to store the results
col_ind_varName of independent variable column, independent variable is an array
col_dep_varName of dependent variable column
regress_familyResponse type (gaussian or binomial)
alphaThe elastic net parameter, [0, 1]
lambda_valueThe regularization parameter
standardizeWhether to normalize the variables (default True)
grouping_colList of columns on which to apply grouping (currently only a placeholder)
optimizerThe optimization algorithm, 'fista' or 'igd'. Default is 'fista'
optimizer_paramsParameters of the above optimizer, the format is 'arg = value, ...'. Default is NULL
excludeWhich 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_iterMaximum number of iterations to run the algorithm (default value of 10000)
toleranceIteration stopping criteria. Default is 1e-6

Definition at line 487 of file elastic_net.sql_in.

text elastic_net_train ( text  family_or_optimizer)
Parameters
family_or_optimizerResponse type, 'gaussian' or 'binomial', or optimizer type

Definition at line 652 of file elastic_net.sql_in.