Predictor -- Classification

On this Page

Overview

This is a Transform type Snap that enables you to predict the class (target/class) field for an unlabeled document. An unlabeled document is one that does not have a class field. So, the Snap reads this unlabeled document and predicts the class field. Predictions are made based on the classification model built by the Trainer (Classification) Snap.

You can configure the Snap to include the confidence level for the prediction. You can additionally specify if the Snap shows multiple predictions for a given input. 

Input and Output

Expected input: An unlabeled document and the classification model. 

Expected output: Predictions from the classification model based on the input document. Multiple predictions are displayed depending upon the configuration of the Max output property. Additionally, the confidence level for each prediction is displayed if the Confidence level property is selected.

Expected upstream Snaps:

  • First input view: Any Snap that generates an unlabeled document. For example, JSON Parser, JSON Generator, CSV Parser, CSV Generator, Mapper, and so on.
  • Second input view: Any Snap that reads and outputs the classification model. For example, a combination of File Reader, and JSON Parser.

Expected downstream SnapsAny Snap that uses the predicted result. For example, Aggregate, or a combination of JSON Formatter and File Writer.

Prerequisites

The input document must be in tabular format (no nested structure). 

Configuring Accounts

Accounts are not used with this Snap.

Configuring Views

Input

This Snap has exactly two document input views. The first input view is for the unlabeled document that requires prediction(s). The second input view is for the classification model.
OutputThis Snap has exactly one document output view.
ErrorThis Snap has at most one document error view.

Troubleshooting

None.

Limitations and Known Issues

None.

Modes


Snap Settings


LabelRequired. 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.
Max output

Required. The maximum number of predictions for each row in the input document. The predictions are in descending order of their confidence level.

Minimum value: 1

Default value: 1

Confidence level

If selected, the Snap's output includes the confidence level for each prediction. The confidence level ranges from 0 to 1. The prediction with the confidence level that is closest to 1 is most likely to be the correct class field. 

Default value: Not selected

Snap Execution

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.
  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.


Examples


Weight Balance Classification – Testing

The model trained in the Weight Balance Classification – Model Training example pipeline is tested against an unlabeled dataset. 

Download this pipeline.

To understand the dataset and the process prior to testing the model see the following examples:

 Understanding the pipeline

Input

In this example, the unlabeled dataset is created using the CSV Generator Snap. This dataset is used as the data input for the Predictor (Classification) Snap. The classification field (Balance class) is to be predicted for this dataset. 

The model trained in the Weight Balance Classification – Model Training example is used as the model input. The File Reader Snap is configured to read this model from the SLDB. The JSON Parser Snap is used to parse the output from the File Reader Snap. Below is a preview of the output from the JSON Parser Snap (the model):

Model Testing

To test a model trained on a classification dataset, the Predictor (Classification) Snap must be used. 

The Predictor (Classification) Snap requires two inputs:

  • An unlabeled dataset for the data input
  • The ML model trained on the labeled dataset for the model input

The Predictor Snap is configured as shown below:

Based on its configuration, the output from the Snap includes one class prediction per document, and also includes the confidence level for the prediction. This output is as shown below:

Download this pipeline.

Additional Example

The following use case demonstrates a real-world scenario for using this Snap:


Downloads

  File Modified

File Weight Balance Classification_Testing.slp

Nov 09, 2018 by Mohammed Iqbal

Snap Pack History

 Click to view/expand

4.27 (427patches13948)

4.27 (main12833)

  • No updates made.

4.26 (main11181)

  • No updates made.

4.25 (main9554)

  • No updates made.

4.24 (main8556)

  • No updates made.

4.23 (main7430)

  • No updates made.

4.22 (main6403)

  • No updates made.

4.21 (snapsmrc542)

  • No updates made.

4.20 Patch mlcore8770

  • Adds the log4j dependency to the ML Core Snaps to resolve the "Could not initialize class org.apache.log4j.LogManager" error. 

4.20 (snapsmrc535)

  • No updates made.

4.19 (snapsmrc528)

  • No updates made.

4.18 (snapsmrc523)

  • No updates made.

4.17 Patch ALL7402

  • Pushed automatic rebuild of the latest version of each Snap Pack to SnapLogic UAT and Elastic servers.

4.17 (snapsmrc515)

  • New Snap: Introducing the Clustering Snap that performs exploratory data analysis to find hidden patterns or groupings in data.
  • Enhanced the AutoML Snap. You can now:
    • Select algorithms to derive the top models.
    • Input the best model generated by another AutoML Snap from a previous execution.
    • View an interactive HTML report that contains statistics of up to 10 models.
  • Added the Snap Execution field to all Standard-mode Snaps. In some Snaps, this field replaces the existing Execute during preview check box.

4.16 (snapsmrc508)

  • New Snap: Introducing the AutoML Snap, which lets you automate the process of selecting machine learning algorithms and tuning hyperparameters. This Snap gives the best predictive model within the specified time limit.

4.15 (snapsmrc500)

  • New Snap Pack. Perform data modeling operations such as model training, cross-validation, and model-based predictions. Additionally, you can also execute Python scripts remotely. Snaps in this Snap Pack are: 
    • Cross Validator -- Classification
    • Cross Validator -- Regression
    • Predictor -- Classification
    • Predictor -- Regression
    • Remote Python Script
    • Trainer -- Classification
    • Trainer -- Regression
  • Releases the Remote Python Executor account and the Remote Python Executor Dynamic account for the Remote Python Script Snap.