This example demonstrates how to use the Multi-Class Classification Agent to categorize events into two or more classes.
The test data used in this example contains ten features (AssetId, Temperature, Proximity, Pressure, Level, Sound, Moisture, Throughput, Flow, Humidity) and one class variable (Class) for a pump. The value of the class variable can be either Malfunction, Working, or Stopped.
Drag the Multi-Class Classification Agent onto the canvas, link the input endpoint to the test data, the output to the printer, and save the Data Stream.
Select the Agent and click Configure. In this case, keep the default Collection.
Set the learning algorithm and parameters.
In this case, leave the learning algorithm as Naive Bayes. Drag the training data file to the training property and the features grid is auto-populated from the training file data.
Set the Variable Type of AssetId to Exclude as this feature is not needed in the training.
Set the Variable Type of Class to Class Variable and change the data type to String.
Set cross validation folds to 3 to avoid overfitting in the model and leave the other options unchanged.
Apply the changes and save the Data Stream.
Select the arrow entering the input endpoint and click Configure.
Map the test data attribute to each training data attribute.
Apply the changes, save the Data Stream, and publish it.
Let's look at the Live Data View. Observe the Predicted Label column of the printed events. Based on the ten feature values, each row is assigned a value of Working, Malfunction, or Stopped.
The value assigned can also be confirmed by comparing the Class and Predicted Label columns.