The Ridge Regression (Tikhonov regularization) algorithm is a common regularization method for the regression analysis of ill-posed problems. The Ridge Regression Training component is based on this algorithm. It supports both sparse and dense data formats, along with training with weighted data samples. This topic describes how to configure the Ridge Regression Training component.
Limits
The supported computing engines are MaxCompute, Flink, or DLC.
Algorithm principle
Ridge Regression is a biased estimation regression method used for the analysis of collinear data. It is an improved version of the least-squares estimation method. It sacrifices the unbiasedness of the least-squares method to obtain more practical and reliable regression coefficients. This trade-off comes at the cost of some information loss and reduced precision but provides a better fit for ill-conditioned data than the standard least-squares method.
Configure component parameters visually
Input Port
Port (from left to right)
Data type
Recommended upstream components
Required
Data
None
Yes
Model
None
No
Parameters
Tab
Parameter
Description
Field Settings
Target column name
The name of the target column in the input table.
Feature column array
This parameter cannot be configured if you have specified Vector column name.
The names of the feature columns used for training.
NoteFeature column array and Vector column name are mutually exclusive. You can use only one of them to specify the input features for the algorithm.
Vector column name
This parameter cannot be configured if you have specified Feature column array.
The name of the vector column.
NoteFeature column array and Vector column name are mutually exclusive. You can use only one of them to specify the input features for the algorithm.
Weight column name
The name of the weight column.
Parameter Settings
Penalty factor: lambda
The coefficient of the regularization term. The data type is DOUBLE.
Convergence threshold
The threshold to determine whether the iterative method has converged. Default value: 1.0E-6.
Learning rate
Controls the speed at which parameters are updated during model training. Default value: 0.1.
Maximum number of iterations
The maximum number of iterations. Default value: 100.
Optimization method
The optimization method used to solve the problem. Valid values:
LBFGS
GD
Newton
SGD
OWLQN
Execution Tuning
Number of workers
Used with the Memory per worker parameter. This parameter must be a positive integer from 1 to 9999.
Memory per worker (MB)
The value ranges from 1024 MB to 64 × 1024 MB.
Output ports
Port (from left to right)
Data type
Downstream components
Model
Regression model
Model information
None
None
Feature importance
None
None
Linear model weight coefficients
None
None
Configure the component using code
You can copy the following code into a PyAlink Script component to achieve the same functionality.
from pyalink.alink import *
def main(sources, sinks, parameter):
batchData = sources[0]
ridge = RidgeRegTrainBatchOp()\
.setLambda(0.1)\
.setFeatureCols(["f0","f1"])\
.setLabelCol("label")
model = batchData.link(ridge)
model.link(sinks[0])
BatchOperator.execute()