On this Page
This is a Transform type Snap that performs K-fold Cross Validation on a classification dataset. Cross validation is a technique for evaluating ML algorithms by splitting the original dataset into K equally-sized chunks. K is the number of folds. In each of the K iterations, K-1 chunks are used to train the model while the last chunk is used as a test set. The average accuracy and other statistics are computed to be used to select the most suitable algorithm for the dataset.
In the settings, you can select the algorithm, specify parameters, and the number of folds. If you want to perform K-fold Cross Validation on regression dataset, use the Cross Validator – Regression Snap instead.
Expected input: The classification dataset.
Expected output: A statistical information about the performance of the selected algorithm on the dataset.
Expected upstream Snap: Any Snap that generates a classification dataset document. For example, CSV Generator, JSON Generator, or a combination of File Reader and JSON Parser.
Expected downstream Snap: CSV/JSON Formatter Snap and File Writer Snap can be used to write the output statistics to file.
Accounts are not used with this Snap.
|This Snap has exactly one document input view.|
|Output||This Snap has exactly one document output view.|
|Error||This Snap has at most one document error view.|
|Label||Required. The name for the Snap. Modify this to be more specific, especially if there are more than one of the same Snap in the pipeline.|
Required. The label or output field in the dataset. This must be a categorical type represented as text (string data type). This is the field that the ML model will be trained to predict.
Default value: None
Required. The classification algorithm to be used to build the model. There are eight classification algorithms available currently:
The implementations are from WEKA, an open source machine learning library in Java.
Default value: Decision Tree
The parameters to be applied on the selected classification algorithm. Each algorithm has a different set of parameters to be configured in this property. If this property is left blank, the default values are applied for all the parameters. If specifying multiple parameters, separate them with a comma ",".
See Options for Algorithms section below for details.
Default value: None
Required. The number of folds.
Minimum value: 2
Default value: 10
|Use random seed|
If selected, Random seed is applied to the randomizer in order to get reproducible results.
Default value: Selected
Required. Number used as static seed for randomizer.
Default value: 12345
Weight Balance Classification – Cross Validation
This pipeline demonstrates a typical cross validation exercise for a dataset before an model is trained for predictions. The dataset is a record of the weight on each side of a weighing scale, the distance of each scale from the ground, and its status of balance. The cross validation is to validate the model's ability to predict this status of balance.
Download this pipeline.
The following use case demonstrates a real-world scenario for using this Snap: