0 ×

Spark Linear Regression Learner (MLlib)

KNIME Extension for Apache Spark core infrastructure version 4.3.1.v202101261633 by KNIME AG, Zurich, Switzerland

This node applies the Apache Spark Linear Regression algorithm. It outputs the learned model for later application.

Please note that all data must be numeric, including the label column. Use the Spark Category To Number nodes to convert nominal values to numeric columns.

Use the Spark Predictor node to apply the learned model to unseen data.


The purpose of the regularizer is to encourage simple models and avoid overfitting. For more details on supported regularizers see the Regularizers section of the MLlib documentation.
The fixed regularization parameter r >= 0 defines the trade-off between the two goals of minimizing the loss (i.e., training error) and minimizing model complexity (i.e., to avoid overfitting).
Number of iterations
The number of iterations the method should run.
Loss function
For more details on the supported loss functions see the Loss function section of the MLlib documentation.
Step size
The initial step size of SGD for the first step. In subsequent steps, the step size will decrease with stepSize/sqrt(t). Only available for SGD.
The fraction of data to be used for each SGD iteration. The default of 1.0 corresponds to deterministic/classical gradient descent. Only available for SGD.
Use feature scaling
Select this option to use feature scaling before model training to reduce the condition numbers which can significantly help the optimizer converging faster. Whether to perform feature scaling before model training to reduce the condition numbers which can significantly help the optimizer converging faster. The scaling correction will be translated back to resulting model weights, so it's transparent to users.
Add intercept
Select this option to add intercept.
Validate data
Select this option if the algorithm should validate data before training.
Class column
The classification column. Must be numeric.
Feature Columns
The feature columns to learn the model from. Supports only numeric columns.

Input Ports

Input Spark DataFrame/RDD

Output Ports

Spark MLlib Linear Regression Model

Best Friends (Incoming)

Best Friends (Outgoing)


To use this node in KNIME, install KNIME Extension for Apache Spark from the following update site:


A zipped version of the software site can be downloaded here.

You don't know what to do with this link? Read our NodePit Product and Node Installation Guide that explains you in detail how to install nodes to your KNIME Analytics Platform.

Wait a sec! You want to explore and install nodes even faster? We highly recommend our NodePit for KNIME extension for your KNIME Analytics Platform. Browse NodePit from within KNIME, install nodes with just one click and share your workflows with NodePit Space.


You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.