0 ×

Spark Random Forests 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 random forests* algorithm.

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. The mapping dictionary of the converter node is the input of the second in port of this node.

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

(*) RANDOM FORESTS is a registered trademark of Minitab, LLC and is used with Minitab’s permission.



Target column
The classification column. Must be numeric.
Feature Columns
The feature columns to learn the model from. Supports only numeric columns.
Number of models
Number of trees in the random forest.
Max number of bins
Maximum number of bins used for splitting features.
Is classification
Select this option for binary or multiclass classification.
Quality measure
Criterion used for information gain calculation. Available methods:
  • gini (recommended)
  • entropy
For more details on the available methods see the MLlib documentation. Only available for classifications.
Max tree depth
Maximum depth of the tree. E.g., depth 0 means 1 leaf node; depth 1 means 1 internal node + 2 leaf nodes.


Feature sampling
Number of features to consider for splits at each node. Supported:
  • auto
  • all
  • sqrt
  • log2
  • onethird
If "auto" is set, this parameter is set based on numTrees: if numTrees == 1, set to "all"; if numTrees > 1 (forest) set to "sqrt".
Random seed for bootstrapping and choosing feature subsets.

Input Ports

Input Spark DataFrame/RDD
PMML with the nominal values mapping dictionary

Output Ports

Spark MLlib Random Forests 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.