User Documentation
 All Files Functions Groups
online_sv.sql_in File Reference

SQL functions for support vector machines. More...

Go to the source code of this file.

Functions

float8 svm_dot (float8[] x, float8[] y)
 Dot product kernel function. More...
 
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...
 
void svm_drop_model (text model_table)
 Drops all tables pertaining to a model. More...
 
float8 svm_predict (text model_table, float8[] ind)
 Evaluates a support-vector model on a given data point. More...
 
set< svm_model_pr > svm_predict_combo (text model_table, float8[] ind)
 Evaluates multiple support-vector models on a data point. 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)
 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)
 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)
 This is the support vector classification function. More...
 
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)
 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...
 
void svm_data_normalization (text input_table)
 Normalizes the data stored in a table, and save the normalized data in a new table. More...
 
set< lsvm_sgd_result > lsvm_classification (text input_table, text model_table, bool parallel)
 This is the linear support vector classification function. More...
 
set< lsvm_sgd_result > lsvm_classification (text input_table, text model_table, bool parallel, bool verbose, float8 eta, float8 reg)
 This is the linear support vector classification function. More...
 
text lsvm_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 linear support-vector model. More...
 
float8 lsvm_predict (text model_table, float8[] ind)
 Evaluates a linear support-vector model on a given data point. More...
 
set< svm_model_pr > lsvm_predict_combo (text model_table, float8[] ind)
 Evaluates multiple linear support-vector models on a data point. More...
 

Detailed Description

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

Definition in file online_sv.sql_in.

Function Documentation

set<lsvm_sgd_result> lsvm_classification ( text  input_table,
text  model_table,
bool  parallel 
)
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
Returns
A summary of the learning process

Definition at line 875 of file online_sv.sql_in.

set<lsvm_sgd_result> lsvm_classification ( text  input_table,
text  model_table,
bool  parallel,
bool  verbose,
float8  eta,
float8  reg 
)
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
verboseVerbosity of reporting
etaInitial learning rate in (0,1]
regRegularization parameter, often chosen by cross-validation
Returns
A summary of the learning process

Definition at line 900 of file online_sv.sql_in.

float8 lsvm_predict ( text  model_table,
float8[]  ind 
)
Parameters
model_tableThe table storing the learned model \( f \) to be used
indThe data point \( \boldsymbol x \)
Returns
This function returns \( f(\boldsymbol x) \)

Definition at line 947 of file online_sv.sql_in.

text lsvm_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

Definition at line 927 of file online_sv.sql_in.

set<svm_model_pr> lsvm_predict_combo ( text  model_table,
float8[]  ind 
)
Parameters
model_tableThe table storing the learned models to be used.
indThe data point \( \boldsymbol x \)
Returns
This function returns a table, a row for each model. Moreover, the last row contains the average value, over all models.

The different models are assumed to be named model_table0, model_table1, ....

Definition at line 968 of file online_sv.sql_in.

set<svm_cls_result> svm_classification ( 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

Definition at line 665 of file online_sv.sql_in.

set<svm_cls_result> svm_classification ( 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
Returns
A summary of the learning process

Definition at line 692 of file online_sv.sql_in.

void svm_data_normalization ( text  input_table)
Parameters
input_tableName of table/view containing the data points to be scored

Definition at line 855 of file online_sv.sql_in.

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.

Definition at line 428 of file online_sv.sql_in.

void svm_drop_model ( text  model_table)
Parameters
model_tableThe table to be dropped.

Definition at line 555 of file online_sv.sql_in.

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 ) \)

Definition at line 452 of file online_sv.sql_in.

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

Definition at line 716 of file online_sv.sql_in.

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
Returns
A summary of the learning process

Definition at line 743 of file online_sv.sql_in.

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 \)

Definition at line 440 of file online_sv.sql_in.

float8 svm_predict ( text  model_table,
float8[]  ind 
)
Parameters
model_tableThe table storing the learned model \( f \) to be used
indThe data point \( \boldsymbol x \)
Returns
This function returns \( f(\boldsymbol x) \)

Definition at line 569 of file online_sv.sql_in.

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

Definition at line 770 of file online_sv.sql_in.

set<svm_model_pr> svm_predict_combo ( text  model_table,
float8[]  ind 
)
Parameters
model_tableThe table storing the learned models to be used.
indThe data point \( \boldsymbol x \)
Returns
This function returns a table, a row for each model. Moreover, the last row contains the average value, over all models.

The different models are assumed to be named model_table1, model_table2, ....

Definition at line 590 of file online_sv.sql_in.

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

Definition at line 613 of file online_sv.sql_in.

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
Returns
A summary of the learning process

Definition at line 641 of file online_sv.sql_in.