This is a Transform type Snap that convertsnumeric fields into categoricalfields. There are two available splitting options: splitting by values and binning.
Input and Output
Expected input
First input view: A document that contains numeric fields.
Second input view: A document that contains data statistics computed by the Profile Snap.
Expected output: A document that contains categorical fields.
Expected upstream Snaps:
First input view: A Snap that has a document output view. Example: CSV Generator Snap.
Second input view: A sequence of File Reader and JSON Parser Snaps. These Snaps read the data statistics computed by the Profile Snap in another pipeline.
Expected downstream Snaps: A Snap that has a document input view. Example: the Aggregate Snap, or a combination of JSON Formatter and File Writer.
Prerequisites
None.
Configuring Accounts
Accounts are not used with this Snap.
Configuring Views
Input
This Snap hasexactlytwo document inputviews,the Datainput view and the Profileinput view.
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.
Policy
The preferences forfields and encoding methods.For each policy, select the input field withcategoricalvalues, theencodingmethod, and the result field.
Field
Required. The field that must be transformed. This is a suggestible property that lists all available fields in the input documents.
Default value: None
Rule
Required. The type of transformation to be performed on the selected field. Two options are available:
Split by Values: Splitting the data into ranges specified by the Splits/Bins property. Each range is replaced with the text specified in the Prefix/Values property.
Binning: Splitting the data into equally-sized ranges based on the number of items specified in the Prefix/Values property. If you specify a prefix value in the Prefix/Values property, you must specify the number of bins in the Splits/Bins property.
Default value: Split by Values
Prefix/Values
Categorical values to be used to replace original numeric values. You can specify either a prefix or multiple values in this property. For example, if the prefix is "group", the values will be "group_1", "group_2" and so on. In case of specifying values, use comma "," to separate them.
Default value: None
Splits/Bins
The values to be entered into this property depends on the selection you made in the Rule property.
Split by Values: This setting must contain a list of split points. "2,4,6,8,10" is the same as "2,4,...,10".
Binning: This property specifies the number of bins into which you want to divide the input data range.
Default value: None
Result field
Required. The result field that must be used in the output map. If the Result fieldis the same as Field, the values are overwritten. If the Result fielddoes not exist in the original input document, a new field is added.
Default value: None
Examples
Converting Numeric Data into Categorical Values
This pipeline demonstrates how you can use the Numeric to Categorical Snap to convert numeric fields into categorical fields.
In this example, the CSV Generator Snap contains sample data with numeric fields. The Copy Snap duplicates the data flow and feeds it into the Numeric to Categorical and Profile Snaps. The Profile Snap generates input data statistics and feeds them into the Numeric to Categorical Snap. The Numeric to Categorical Snap then converts the numeric values in the fields of your choice into categorical values, based on the splitting method you select.
Enter the following data into the CSV Generator Snap:
First, we need to convert values in $experience into numeric values. We do this using a Type Converter Snap with the Auto check box selected.
We want to categorize employees based on their years of experience into "junior", "senior", and "principal". We choose Binning in the Rule property to ensure that the data ranges after splitting are equally spaced.
The Numeric to Categorical Snap contains the following settings:
The Profile Snap computes the min and max values in the input data, which is required by Binning.
As you can see, $experience contains min and max values, which are 1 and 22 respectively.
The preview output of the Numeric to Categorical Snap is shown below. This Snap adds one field to the output.
$level: This field displays categories of employees based on their years of experience.
Upgraded the org.json.json library from v20090211 to v20240303, which is fully backward compatible.
Enhanced the Date Time Extractor Snap to support Date time formats (YYYY-MM-dd HH:mm:ss and YYYY-MM-dd HH:mm:ss.SSS) and allow the root path to auto-convert all fields.
May 2024
main26341
Stable
Updated and certified against the current SnapLogic Platform release.
February 2024
436patches25781
Latest
Enhanced the Deduplicate Snap to honor an interrupt while waiting in the delay loop to manage the memory efficiently.
February 2024
main25112
Stable
Updated and certified against the current SnapLogic Platform release.
November 2023
main23721
Nov 8, 2023
Stable
Updated and certified against the current SnapLogic Platform release.
August 2023
main22460
Aug 16, 2023
Stable
Updated and certified against the current SnapLogic Platform release.
May 2023
433patches21572
Latest
The Deduplicate Snap now manages memory efficiently and eliminates out-of-memory crashes using the following fields:
Minimum memory (MB)
Minimum free disk space (MB)
May 2023
433patches21247
Latest
Fixed an issue with the Match Snap where a null pointer exception was thrown when the second input view had fewer records than the first.
May 2023
main21015
Stable
Upgraded with the latest SnapLogic Platform release.
February 2023
main19844
Stable
Upgraded with the latest SnapLogic Platform release.
December 2022
431patches19268
Latest
The Deduplicate Snap now ignores fields with empty strings and whitespaces as no data.
November 2022
main18944
Stable
Upgraded with the latest SnapLogic Platform release.
August 2022
main17386
Stable
Upgraded with the latest SnapLogic Platform release.
4.29
main15993
Stable
Upgraded with the latest SnapLogic Platform release.
4.28
main14627
Stable
Enhanced the Type Converter Snap with the Fail safe upon execution checkbox. Select this checkbox to enable the Snap to convert data with valid data types, while ignoring invalid data types.
4.27
427patches13730
Enhanced the Type Converter Snap with the Fail safe upon executioncheckbox. Select this checkbox to enable the Snap to ignore invalid data types and convert data with valid data types.
4.27
427patches13948
Latest
Fixed an issue with the Principal Component Analysis Snap, where a deadlock occurred when data is loaded from both the input views.
4.27
main12833
Stable
Upgraded with the latest SnapLogic Platform release.
4.26
main11181
Stable
Upgraded with the latest SnapLogic Platform release.
4.25
425patches10994
Fixed an issue when the Deduplicate Snap where the Snap breaks when running on a locale that does not format decimals with Period (.) character.
4.25
main9554
Stable
Upgraded with the latest SnapLogic Platform release.
4.24
main8556
Stable
Upgraded with the latest SnapLogic Platform release.
4.23
main7430
Stable
Upgraded with the latest SnapLogic Platform release.
4.22
main6403
Stable
Upgraded with the latest SnapLogic Platform release.
4.21
snapsmrc542
Stable
Introduces the Mask Snap that enables you to hide sensitive information in your dataset before exporting the dataset for analytics or writing the dataset to a target file.
Enhances theMatch Snap to add a new field,Match all, which matches one record from the first input with multiple records in the second input. Also, enhances theComparatorfield in the Snap by adding one more option,Exact, which identifies and classifies a match as either an exact match or not a match at all.
Enhances the DeduplicateSnap to add a new field,Group ID, which includes the Group ID for each record in the output. Also, enhances theComparatorfield in the Snap by adding one more option,Exact, which identifies and classifies a match as either an exact match or not a match at all.
Enhances the SampleSnap by adding a second output view which displays data that is not in the first output. Also, a new algorithm type,Linear Split, which enables you to split the dataset based on the pass-through percentage.
4.20 Patch
mldatapreparation8771
Latest
Removes the unused jcc-optionaldependency from the ML Data Preparation Snap Pack.
4.20
snapsmrc535
Stable
Upgraded with the latest SnapLogic Platform release.
4.19
snapsmrc528
Stable
New Snap: Introducing the Deduplicate Snap. Use this Snap to remove duplicate records from input documents. When you use multiple matching criteria to deduplicate your data, it is evaluated using each criterion separately, and then aggregated to give the final result.
4.18
snapsmrc523
Stable
Upgraded with the latest SnapLogic Platform release.
4.17 Patch
ALL7402
Latest
Pushed automatic rebuild of the latest version of each Snap Pack to SnapLogic UAT and Elastic servers.
4.17
snapsmrc515
Latest
New Snap: Introducing the Feature Synthesis Snap, which automatically createsfeatures out of multiple datasets that share a one-to-one or one-to-many relationship with each other.
New Snap: Introducing the Match Snap, which enables you to automatically identify matched records across datasets that do not have a common key field.
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
Stable
Added a new Snap, Principal Component Analysis, which enables you to perform principal component analysis (PCA) on numeric fields (columns) to reduce dimensions of the dataset.
4.15
snapsmrc500
Stable
New Snap Pack. Perform preparatory operations on datasets such as data type transformation, data cleanup, sampling, shuffling, and scaling. Snaps in this Snap Pack are: