|
MADlib
1.1 A newer version is available
User Documentation
|
SQL functions for cross validation. More...
Go to the source code of this file.
Functions | |
| void | cv_linregr_train (varchar tbl_source, varchar col_ind_var, varchar col_dep_var, varchar tbl_result) |
| Simple interface of cross-validation, which has no limitation on lock number. More... | |
| void | cv_linregr_predict (varchar tbl_model, varchar tbl_newdata, varchar col_ind_var, varchar col_id, varchar tbl_predict) |
| A wrapper for linear regression prediction. | |
| boolean | logregr_predict (float8[] coef, float8[] col_ind) |
| A prediction function for logistic regression. More... | |
| void | cv_logregr_predict (varchar tbl_model, varchar tbl_newdata, varchar col_ind_var, varchar col_id, varchar tbl_predict) |
| A prediction function for logistic regression The result is stored in the table of tbl_predict. More... | |
| integer | logregr_accuracy (float8[] coef, float8[] col_ind, boolean col_dep) |
| Metric function for logistic regression. More... | |
| void | cv_logregr_accuracy (varchar tbl_predict, varchar tbl_source, varchar col_id, varchar col_dep_var, varchar tbl_accuracy) |
| Metric function for logistic regression. More... | |
Definition in file cross_validation.sql_in.
| void cv_linregr_train | ( | varchar | tbl_source, |
| varchar | col_ind_var, | ||
| varchar | col_dep_var, | ||
| varchar | tbl_result | ||
| ) |
| module_name | Module to be cross validated |
| func_args | Arguments of modelling function of the module, including the table name of data |
| param_to_try | The name of the paramter that CV runs through |
| param_values | The values of the parameter that CV will try |
| data_id | Name of the unique ID associated with each row. Provide NULL if there is no such column in the data table |
| id_is_random | Whether the provided ID is randomly assigned to each row |
| validation_result | Table name to store the output of CV function, see the Output for format. It will be automatically created by CV function |
| fold_num | How many fold cross-validation Print the help message for a given module's cross-validation. Print the supported module names for cross_validation A wrapper for linear regression |
Definition at line 366 of file cross_validation.sql_in.
| void cv_logregr_accuracy | ( | varchar | tbl_predict, |
| varchar | tbl_source, | ||
| varchar | col_id, | ||
| varchar | col_dep_var, | ||
| varchar | tbl_accuracy | ||
| ) |
It computes the percentage of correct predictions. The result is stored in the table of tbl_accuracy
Definition at line 481 of file cross_validation.sql_in.
| void cv_logregr_predict | ( | varchar | tbl_model, |
| varchar | tbl_newdata, | ||
| varchar | col_ind_var, | ||
| varchar | col_id, | ||
| varchar | tbl_predict | ||
| ) |
This function can be used together with cross-validation
Definition at line 447 of file cross_validation.sql_in.
| integer logregr_accuracy | ( | float8[] | coef, |
| float8[] | col_ind, | ||
| boolean | col_dep | ||
| ) |
| coef | Logistic fitting coefficients. Note: MADlib logregr_train function does not produce a seperate intercept term as elastic_net_train function. |
| col_ind | Independent variable, an array |
| col_dep | Dependent variable |
returns 1 if the prediction is the same as col_dep, otherwise 0
Definition at line 467 of file cross_validation.sql_in.
| boolean logregr_predict | ( | float8[] | coef, |
| float8[] | col_ind | ||
| ) |
| coef | Coefficients. Note: MADlib logregr_train function does not produce a seperate intercept term as elastic_net_train function. |
| col_ind | Independent variable, which must be an array |
Definition at line 434 of file cross_validation.sql_in.