You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
2 years ago | |
|---|---|---|
| .. | ||
| Python Integration | 3 years ago | |
| Makefile | 3 years ago | |
| README.md | 3 years ago | |
| action.cpp | 2 years ago | |
| demo.aquery | 3 years ago | |
| democa.aqp | 3 years ago | |
| democq.aqp | 3 years ago | |
| demoi.aqp | 3 years ago | |
| prep.a | 3 years ago | |
| putdata.cpp | 3 years ago | |
| query.cpp | 3 years ago | |
| setup.sh | 3 years ago | |
| test.a | 3 years ago | |
README.md
Triggers Demo
This folder contains a demo workflow for the two types of triggers.
- An interval-based trigger will be set up to execute a stored procedure
demoidefined in demo/putdata.cpp that inserts a .csv file fromdata/electricityto the tablesourceevery 5 seconds. - A Conditional trigger will be triggered by condition
democqdefined in demo/query.cpp that checks and returns true when more than 200 rows of data are inserted into tablesource. Once triggered, it will execute a stored proceduredemocadefined in demo/democa.cpp that trains the incremental random forest by the new data. - See demo/prep.a for parameters of the random forest.
Run the demo
Preparation
- Preprocess data
- Put
electricitydataset to/data/electricity_orig - Run
python3 rfdata_preproc.pyto generate .csv files todata/electricity/
- Put
- Use demo/setup.sh to
- setup stored procedures for this demo
- compile random forest user module used in this demo
- compile queries used in this demo
Running the demo
- Run AQuery prompt
python3 prompt.py - Use Automated AQuery script in demo/demo.aquery to execute the workflow. It does the following things in order:
- Register user module, create a new random forest by running
f demo/prep.a - Register stored procedures.
- Create an Interval-based Trigger that executes payload
demoievery 5 seconds - Create a Conditional Trigger that executes payload
democawhenever conditiondemocqreturns a true. While conditiondemocqis tested every time new data is inserted to tablesource. - Loads test data by running demo/test.a
- Register user module, create a new random forest by running
- Use query
select predict(x) from testto get predictions of the test data from current random forest.- In AQuery prompt, an extra
execcommand after the query is needed to execute the query.
- In AQuery prompt, an extra
- Use query
select test(x, y) from testwill also calculate l2 error.