This topic describes the support vector regression (SVR) algorithm.
Overview
SVR is an application branch of support vector machine (SVM). SVR can be used to find a regression plane from which all data elements in a set have the shortest distance.
Scenarios
SVR is a regression model that is primarily used to fit values and in scenarios with sparse features and a small number of features.
For example, an SVR model can be used to predict the temperature of a city. The input includes many features, such as the average temperature of the city within a period, greening rate, the number of lakes, and the date. The temperature of the city within a period can be used to train the model.
Parameters
The parameters in the following table are the values of the model_parameter
parameters in the CREATE MODEL
statement for creating a model. You can select the values based on your needs.
Parameter | Description |
---|---|
kernel | The kernel function, which is used to map low-dimensional data to high-dimensional space. Default value: rbf. Valid values:
|
c | The penalty coefficient of the relaxation coefficient. It is a floating-point number greater than 0 and can be left empty. Default value: 1. Note If the data quality is poor, you can appropriately decrease the value of the c parameter. |
epsilon | The threshold of the SVR loss function. When the difference between the predicted value and the actual value is equal to the threshold, the loss of the sample is calculated. Default value: 0.1. |
max_iter | The maximum number of iterations. Valid values: positive integer and -1. Default value: -1. Note If this parameter is set to -1, the iteration continues until it converges to the epsilon value. |
Examples
/*polar4ai*/
CREATE MODEL svr1 WITH
( model_class = 'svr', x_cols = 'dx1,dx2', y_cols='y',
model_parameter=(kernel='rbf')) AS (select * from db4ai.testdata1)
/*polar4ai*/select dx1,dx2 FROM
PREDICT(MODEL svr1, select * from db4ai.testdata1 limit 10)
WITH (x_cols = 'dx1,dx2', y_cols='')
x_cols
and y_cols
must use floating-point or integer data.