Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #203 from ChariniNana/master
Browse files Browse the repository at this point in the history
Add prediction sample
suhothayan authored Jun 23, 2017
2 parents 9607214 + f324d07 commit e3b1622
Showing 3 changed files with 35 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/samples/artifacts/0025/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
1. Copy {WSO2DASHome}/samples/0025/ml-prediction-sample.siddhi file to {WSO2DASHome}/deployment/siddhi-files.
In ml-prediction-sample.siddhi file, replace "<CARBON-HOME>" with the absolute path to DAS home.

2. Start the worker using ./{WSO2DASHome}/bin/worker.sh

3. Run the following curl command to simulate prediction using the test-model
curl -X POST http://localhost:9090/simulation/single -H 'content-type: text/plain'
-d '{"siddhiAppName": "ml-prediction-sample",
"streamName": "inputStream",
"timestamp": null,
"data": ["2", "84", "0", "0", "0", "0.0", "0.304", "21"]}'

4. See the output in the WSO2DAS terminal
22 changes: 22 additions & 0 deletions modules/samples/artifacts/0025/ml-prediction-sample.siddhi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@App:name("ml-prediction-sample")

-- Please refer to https://docs.wso2.com/display/DAS400/Quick+Start+Guide on getting started with DAS editor.

define stream inputStream (NumPregnancies double, PG2 double, DBP double, TSFT double, SI2 double, BMI double, DPF double, Age double);

define stream outputStream (NumPregnancies double, PG2 double, DBP double, TSFT double, SI2 double, BMI double, DPF double, Age double, Class double);

@info(name = 'query1')
from inputStream#ml:predict('<CARBON-HOME>/samples/artifacts/0024/test-model','double')
select *
insert into outputStream;

from outputStream#log("OutputLog")
insert into tempStream;







Binary file added modules/samples/artifacts/0025/test-model
Binary file not shown.

0 comments on commit e3b1622

Please sign in to comment.