Performing Streaming Learning Using a Clustree Model¶
This sample demonstrates how to perform unsupervised streaming learning on a set of data points using a Clustree model.
Before you begin:
siddhi-gpl-execution-streamingml-x.x.x.jarfrom here and place it in the
- Copy the
<SI_TOOLING_HOME>/samples/artifacts/ClusTreeSample/clusTreeTestFeed.jsonfile and place it in the
- Copy the
<SI_TOOLING_HOME>/samples/artifacts/ClusTreeSample/clusTreeFileTest.csvfile and place it in the
- Save the sample Siddhi application in Streaming Integrator Tooling.
Executing the Sample¶
To execute the sample open the saved Siddhi application in Streaming Integrator Tooling, and start it by clicking the Start button (shown below) or by clicking Run => Run.
If the Siddhi application starts successfully, the following message appears in the console.
ClusTreeTestApp.siddhi - Started Successfully!
Testing the Sample¶
To test the sample Siddhi application, simulate multiple events via CSV file in the Streaming Integrator Tooling as follows:
To open the Event Simulator, click the Event Simulator icon.
This opens the event simulation panel.
In the Feed Simulation tab of the panel you can see that the clusTreeTestFeed.csv file is loaded.
Press the play button to start simulation.
Viewing the Results¶
After clicking the play button see the output on the console, that are produced according to the simulation from csv file.
Click here to view the sample Siddhi application.
@App:name("ClusTreeTestApp") define stream InputStream (x double, y double); @sink(type='log') define stream logStream (closestCentroidCoordinate1 double,closestCentroidCoordinate2 double,x double, y double); @info(name = 'query1') from InputStream#streamingml:clusTree(2, 10, 20, 5, 50, x, y) select closestCentroidCoordinate1, closestCentroidCoordinate2, x, y insert into logStream;