1.8
User Documentation for MADlib
online_sv.sql_in File Reference

SQL functions for support vector machines. More...

Functions

float8 svm_dot (float8[] x, float8[] y)
 Dot product kernel function. More...
 
float8 svm_dot (float8[] x, float8[] y, float8 placeholder)
 
float8 svm_polynomial (float8[] x, float8[] y, float8 degree)
 Polynomial kernel function. More...
 
float8 svm_gaussian (float8[] x, float8[] y, float8 gamma)
 Gaussian kernel function. More...
 
float8 svm_predict_sub (int, int, float8[], float8[], float8[], text, float8)
 
float8 svm_predict (svm_model_rec svs, float8[] ind, text kernel, float8 kernel_param)
 
svm_model_rec svm_reg_update (svm_model_rec svs, float8[] ind, float8 label, text kernel, float8 eta, float8 nu, float8 slambda, float8 kernel_param)
 
aggregate svm_model_rec svm_reg_agg (float8[], float8, text, float8, float8, float8, float8)
 
svm_model_rec svm_cls_update (svm_model_rec svs, float8[] ind, float8 label, text kernel, float8 eta, float8 nu, float8 kernel_param)
 
aggregate svm_model_rec svm_cls_agg (float8[], float8, text, float8, float8, float8)
 
svm_model_rec svm_nd_update (svm_model_rec svs, float8[] ind, text kernel, float8 eta, float8 nu, float8 kernel_param)
 
aggregate svm_model_rec svm_nd_agg (float8[], text, float8, float8, float8)
 
void svm_store_model (text model_temp_table, text model_name, text model_table)
 
void svm_drop_model (text model_table)
 Drops all tables pertaining to a model. More...
 
set< svm_reg_result > svm_regression (text input_table, text model_table, bool parallel, text kernel_func)
 This is the support vector regression function. More...
 
set< svm_reg_result > svm_regression (text input_table, text model_table, bool parallel, text kernel_func, bool verbose, float8 eta, float8 nu, float8 slambda, float8 kernel_param)
 This is the support vector regression function. More...
 
set< svm_reg_result > svm_regression (text input_table, text model_table, bool parallel, text kernel_func, bool verbose, float8 eta, float8 nu, float8 slambda)
 This is the support vector regression function. More...
 
set< svm_cls_result > svm_classification (text input_table, text model_table, bool parallel, text kernel_func, float8 kernel_param)
 This is the support vector classification function. More...
 
set< svm_cls_result > svm_classification (text input_table, text model_table, bool parallel, text kernel_func)
 
set< svm_cls_result > svm_classification (text input_table, text model_table, bool parallel, text kernel_func, bool verbose, float8 eta, float8 nu, float8 kernel_param)
 This is the support vector classification function. More...
 
set< svm_cls_result > svm_classification (text input_table, text model_table, bool parallel, text kernel_func, bool verbose, float8 eta, float8 nu)
 
set< svm_nd_result > svm_novelty_detection (text input_table, text model_table, bool parallel, text kernel_func)
 This is the support vector novelty detection function. More...
 
set< svm_nd_result > svm_novelty_detection (text input_table, text model_table, bool parallel, text kernel_func, bool verbose, float8 eta, float8 nu, float8 kernel_param)
 This is the support vector novelty detection function. More...
 
set< svm_nd_result > svm_novelty_detection (text input_table, text model_table, bool parallel, text kernel_func, bool verbose, float8 eta, float8 nu)
 This is the support vector novelty detection function. More...
 
text svm_predict_batch (text input_table, text data_col, text id_col, text model_table, text output_table, bool parallel)
 Scores the data points stored in a table using a learned support-vector model. More...
 
float8[] __svm_random_ind (int d)
 
float8[] __svm_random_ind2 (int d)
 
void svm_generate_reg_data (text output_table, int num, int dim)
 
float8 __svm_target_reg_func (float8[] ind)
 
void svm_generate_cls_data (text output_table, int num, int dim)
 
float8 __svm_target_cl_func (float8[] ind)
 
void svm_generate_nd_data (text output_table, int num, int dim)
 
void svm_data_normalization (text input_table)
 Normalizes the data stored in a table, and save the normalized data in a new table. More...
 

Detailed Description

See also
For an introduction to Support vector machines (SVMs) and related kernel methods, see the module description Support Vector Machines.

Function Documentation

float8 [] __svm_random_ind ( int  d)
float8 [] __svm_random_ind2 ( int  d)
float8 __svm_target_cl_func ( float8[]  ind)
float8 __svm_target_reg_func ( float8[]  ind)
set<svm_cls_result> svm_classification ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func,
float8  kernel_param 
)
Parameters
input_tableThe name of the table/view with the training data
model_tableThe name of the table under which we want to store the learned model
parallelA flag indicating whether the system should learn multiple models in parallel
kernel_funcKernel function
Returns
A summary of the learning process
set<svm_cls_result> svm_classification ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func 
)
set<svm_cls_result> svm_classification ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func,
bool  verbose,
float8  eta,
float8  nu,
float8  kernel_param 
)
Parameters
input_tableThe name of the table/view with the training data
model_tableThe name of the table under which we want to store the learned model
parallelA flag indicating whether the system should learn multiple models in parallel
kernel_funcKernel function
verboseVerbosity of reporting
etaLearning rate in (0,1]
nuCompression parameter in (0,1] associated with the fraction of training data that will become support vectors
kernel_paramDefault parameter for kernel function
Returns
A summary of the learning process
set<svm_cls_result> svm_classification ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func,
bool  verbose,
float8  eta,
float8  nu 
)
aggregate svm_model_rec svm_cls_agg ( float8  [],
float8  ,
text  ,
float8  ,
float8  ,
float8   
)
svm_model_rec svm_cls_update ( svm_model_rec  svs,
float8[]  ind,
float8  label,
text  kernel,
float8  eta,
float8  nu,
float8  kernel_param 
)
void svm_data_normalization ( text  input_table)
Parameters
input_tableName of table/view containing the data points to be scored
float8 svm_dot ( float8[]  x,
float8[]  y 
)
Parameters
xThe data point \( \boldsymbol x \)
yThe data point \( \boldsymbol y \)
Returns
Returns dot product of the two data points.
float8 svm_dot ( float8[]  x,
float8[]  y,
float8  placeholder 
)
void svm_drop_model ( text  model_table)
Parameters
model_tableThe table to be dropped.
float8 svm_gaussian ( float8[]  x,
float8[]  y,
float8  gamma 
)
Parameters
xThe data point \( \boldsymbol x \)
yThe data point \( \boldsymbol y \)
gammaThe spread \( \gamma \)
Returns
Returns \( K(\boldsymbol x,\boldsymbol y)=exp(-\gamma || \boldsymbol x \cdot \boldsymbol y ||^2 ) \)
void svm_generate_cls_data ( text  output_table,
int  num,
int  dim 
)
void svm_generate_nd_data ( text  output_table,
int  num,
int  dim 
)
void svm_generate_reg_data ( text  output_table,
int  num,
int  dim 
)
aggregate svm_model_rec svm_nd_agg ( float8  [],
text  ,
float8  ,
float8  ,
float8   
)
svm_model_rec svm_nd_update ( svm_model_rec  svs,
float8[]  ind,
text  kernel,
float8  eta,
float8  nu,
float8  kernel_param 
)
set<svm_nd_result> svm_novelty_detection ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func 
)
Parameters
input_tableThe name of the table/view with the training data
model_tableThe name of the table under which we want to store the learned model
parallelA flag indicating whether the system should learn multiple models in parallel
kernel_funcKernel function
Returns
A summary of the learning process
set<svm_nd_result> svm_novelty_detection ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func,
bool  verbose,
float8  eta,
float8  nu,
float8  kernel_param 
)
Parameters
input_tableThe name of the table/view with the training data
model_tableThe name of the table under which we want to store the learned model
parallelA flag indicating whether the system should learn multiple models in parallel
kernel_funcKernel function
verboseVerbosity of reporting
etaLearning rate in (0,1]
nuCompression parameter in (0,1] associated with the fraction of training data that will become support vectors
kernel_paramDefault parameter for kernel function
kernel_param
Returns
A summary of the learning process
set<svm_nd_result> svm_novelty_detection ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func,
bool  verbose,
float8  eta,
float8  nu 
)
Parameters
input_tableThe name of the table/view with the training data
model_tableThe name of the table under which we want to store the learned model
parallelA flag indicating whether the system should learn multiple models in parallel
kernel_funcKernel function
verboseVerbosity of reporting
etaLearning rate in (0,1]
nuCompression parameter in (0,1] associated with the fraction of training data that will become support vectors
kernel_paramDefault parameter for kernel function
kernel_param
Returns
A summary of the learning process
float8 svm_polynomial ( float8[]  x,
float8[]  y,
float8  degree 
)
Parameters
xThe data point \( \boldsymbol x \)
yThe data point \( \boldsymbol y \)
degreeThe degree \( d \)
Returns
Returns \( K(\boldsymbol x,\boldsymbol y)=(\boldsymbol x \cdot \boldsymbol y)^d \)
float8 svm_predict ( svm_model_rec  svs,
float8[]  ind,
text  kernel,
float8  kernel_param 
)
text svm_predict_batch ( text  input_table,
text  data_col,
text  id_col,
text  model_table,
text  output_table,
bool  parallel 
)
Parameters
input_tableName of table/view containing the data points to be scored
data_colName of column in input_table containing the data points
id_colName of column in input_table containing the integer identifier of data points
model_tableName of table where the learned model to be used is stored
output_tableName of table to store the results
parallelA flag indicating whether the model to be used was learned in parallel
Returns
Textual summary of the algorithm run
float8 svm_predict_sub ( int  ,
int  ,
float8  [],
float8  [],
float8  [],
text  ,
float8   
)
aggregate svm_model_rec svm_reg_agg ( float8  [],
float8  ,
text  ,
float8  ,
float8  ,
float8  ,
float8   
)
svm_model_rec svm_reg_update ( svm_model_rec  svs,
float8[]  ind,
float8  label,
text  kernel,
float8  eta,
float8  nu,
float8  slambda,
float8  kernel_param 
)
set<svm_reg_result> svm_regression ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func 
)
Parameters
input_tableThe name of the table/view with the training data
model_tableThe name of the table under which we want to store the learned model
parallelA flag indicating whether the system should learn multiple models in parallel
kernel_funcKernel function
Returns
A summary of the learning process
set<svm_reg_result> svm_regression ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func,
bool  verbose,
float8  eta,
float8  nu,
float8  slambda,
float8  kernel_param 
)
Parameters
input_tableThe name of the table/view with the training data
model_tableThe name of the table under which we want to store the learned model
parallelA flag indicating whether the system should learn multiple models in parallel
kernel_funcKernel function
verboseVerbosity of reporting
etaLearning rate in (0,1]
nuCompression parameter in (0,1] associated with the fraction of training data that will become support vectors
slambdaRegularisation parameter
kernel_paramDefault parameter for kernel function
Returns
A summary of the learning process
set<svm_reg_result> svm_regression ( text  input_table,
text  model_table,
bool  parallel,
text  kernel_func,
bool  verbose,
float8  eta,
float8  nu,
float8  slambda 
)
Parameters
input_tableThe name of the table/view with the training data
model_tableThe name of the table under which we want to store the learned model
parallelA flag indicating whether the system should learn multiple models in parallel
kernel_funcKernel function
verboseVerbosity of reporting
etaLearning rate in (0,1]
nuCompression parameter in (0,1] associated with the fraction of training data that will become support vectors
slambdaRegularisation parameter
kernel_paramDefault parameter for kernel function
Returns
A summary of the learning process
void svm_store_model ( text  model_temp_table,
text  model_name,
text  model_table 
)