The input document is generated by the CSV Generator Snap and is composed of four fields, one classification field and three numeric fields:
- Balance Class: The classification field to denote status of the weighing scale. B for Balanced, L for Left-inclined, and R for Right-inclined.
- Left Weight
- Left Distance
- Right Weight
- Right Distance
Use Trainer (Classification) Snap to train the model for the dataset.
This input document is passed through the Type Converter Snap that is configured to automatically detect and convert the data types. In any ML pipeline, you must first analyze the input document using the Profile Snap and the Type Inspector Snap to ensure that there are no null values or that the data types are accurate. This step is skipped in this example for simplicity's sake.
Since the training algorithm was evaluated in the Cross Validator (Classification) Snap, the Trainer (Classification) Snap is configured with the same settings:
The output from this Snap is as shown below:
The model in the Trainer (Classification) Snap's output is written into a file using the File Writer Snap which is configured as shown below:
This model is used to predict the Balance Class for an unlabeled dataset. See Weight Balance Classification – Testing for details.
Download this pipeline.