Towards an Association and Sequential Rule Mining Algorithm for Context Prediction
877
Towards an Association and Sequential Rule Mining Algorithm for Context Prediction
This is a short tutorial on how to run the asra docker image locally.
You may use the following commands, or Kitematic, which is a GUI for Docker.
First, we create the docker container and open the web port to our host.
docker run --name asra --hostname localhost -p 80:80 matfax/asra:latest
Notice that the latest tag points to the dev branch, and the version number tags (e.g., 1.x.x) feature the regarding released version from the master branch.
The command will output the console of the new machine as long as you keep it opened. That might be interesting to track the progress or to inspect errors, but you may close it at any time. After closing the console, the container will keep running in the background.
When you have closed the console, you can still inspect the logs in Kitematic. Red messages indicate errors, yellow messages indicate warnings (mandatory). Blue messages contain major results, and green indicators show that a subtask has been completed.
Now, we can reach the web interface on the localhost.
Let's try to create the first aggregation task.
To send requests to the API, we can use Swagger UI that is located in the subpath /api/.
Next, we expand the task, and /task/create section.
There, we can use the following JSON input to create the first task.
{
"baseConfig": {
"yearlyPartition": false,
"categorizationCache": true,
"numberOfRetries": 5,
"clusteringNumber": 40,
"clusteringBorderPoints": true,
"outputCompression": true,
"workers": 2,
"compression": true,
"minSupport": 0.8,
"slidingWindow": 20,
"classifierSelection": {
"map": {
"Bluetooth Sensor Data": false,
"Common Time": true,
"GPS Sensor Data": true,
"Audio Inference": false,
"Activity Inference": false,
"Charging Status": true,
"Wifi Sensor Data": true,
"Conversation Inference Status": true,
"Smartphone Lock Status": true,
"Dark Environment": true
}
},
"slidingWindowInterval": 1,
"classificationCache": true,
"miningTimeout": "30m",
"minConf": 1,
"evalWorkers": 2,
"miningLimit": 0,
"checkConfidence": true,
"clusteringEpsilon": 0.0001,
"end": 1,
"removeSensorData": true,
"outputEnablePartitioning": false,
"caching": true,
"dropTime": true,
"start": 0,
"miningPredictionWindow": 60,
"mergingCache": true,
"outputPartitions": 1,
"keepPeriod": true
},
"range": {
"minSupport": [0.7, 0.8]
}
}
The example stated above creates an aggregation task with two evaluation subtasks. The first uses the base configuration parameters with a minSupport of 0.7, the second one with a minSupport of 0.8.
Please notice that evalWorkers > 1 is currently not bug proof due to caching conflicts.
If errors occur, the application will try to restart the affected tasks.
If errors shouldn't be self-healed after a (e.g, 5 minutes), try to use evalWorkers = 1 and in turn increase the workers = 4.
More workers will only make a difference if end - start >= workers.
Make sure that the API request returns a valid response (i.e., the new task number).
{
"number": 0
}
You may change any other parameter. All parameters are described in the /api-docs/.
To actually start the task, we use the /task/{number}/create section.
Simply provide the new task number and send a request. If the request is valid, the same number will be returned.
{
"number": 0
}
Now, the new task has started evaluating.
We can check the status of the new task in the /task/{number}/status section.
At the beginning, the response may look like this:
{
"taskNumber": {
"number": 0
},
"completedEvaluations": [
{
"caching": true,
"removeSensorData": true,
"outputEnablePartitioning": false,
"outputPartitions": 1,
"start": 0,
"end": 1,
"classificationCache": true,
"mergingCache": true,
"categorizationCache": true,
"outputCompression": true,
"checkConfidence": true,
"maxRows": 10,
"truncate": true,
"dropTime": true,
"minConf": 1,
"minSupport": 0.8,
"slidingWindow": 20,
"slidingWindowInterval": 1,
"miningLimit": 0,
"miningPredictionWindow": 60,
"miningTimeout": "1800s",
"workers": 2,
"evalWorkers": 2,
"compression": true,
"yearlyPartition": false,
"clusteringEpsilon": 0.0001,
"clusteringNumber": 40,
"clusteringBorderPoints": true,
"numberOfRetries": 5,
"classifierSelection": {
"map": {
"Bluetooth Sensor Data": false,
"Common Time": true,
"GPS Sensor Data": true,
"Audio Inference": false,
"Activity Inference": false,
"Charging Status": true,
"Wifi Sensor Data": true,
"Conversation Inference Status": true,
"Smartphone Lock Status": true,
"Dark Environment": true
}
}
}
],
"pendingEvaluations": [],
"processingEvaluations": [
{
"config": {
"caching": true,
"removeSensorData": true,
"outputEnablePartitioning": false,
"outputPartitions": 1,
"start": 0,
"end": 1,
"classificationCache": true,
"mergingCache": true,
"categorizationCache": true,
"outputCompression": true,
"checkConfidence": true,
"maxRows": 10,
"truncate": true,
"dropTime": true,
"minConf": 1,
"minSupport": 0.7,
"slidingWindow": 20,
"slidingWindowInterval": 1,
"miningLimit": 0,
"miningPredictionWindow": 60,
"miningTimeout": "1800s",
"workers": 2,
"evalWorkers": 2,
"compression": true,
"yearlyPartition": false,
"clusteringEpsilon": 0.0001,
"clusteringNumber": 40,
"clusteringBorderPoints": true,
"numberOfRetries": 5,
"classifierSelection": {
"map": {
"Bluetooth Sensor Data": false,
"Common Time": true,
"GPS Sensor Data": true,
"Audio Inference": false,
"Activity Inference": false,
"Charging Status": true,
"Wifi Sensor Data": true,
"Conversation Inference Status": true,
"Smartphone Lock Status": true,
"Dark Environment": true
}
}
},
"completedTestSets": [
{
"number": 1
}
],
"pendingTestSets": [],
"processingTestSets": [
{
"testSet": {
"number": 0
},
"currentState": "MINING"
}
]
}
]
}
It shows that both tasks are in processingEvaluations.
Both test sets (i.e., 0, and 1) are listed in processingTestSets, respectively.
The values under the currentState keys show the progress of both test sets.
The progress order is as mentioned below:
The CompleteActor does not do anything but to show that the task is complete.
Normally, you don't see this progress state because the test sets then move to the completedTestSets key.
Once all test sets of an evaluation subtask are completed, the evaluation subtask is moved to the completedEvaluations key, respectively.
You may request the results of complete evaluation subtasks anytime via the section /task/{number}/result.
{
"taskNumber": {
"number": 0
},
"results": [
{
"config": {
"caching": true,
"removeSensorData": true,
"outputEnablePartitioning": false,
"outputPartitions": 1,
"start": 0,
"end": 1,
"classificationCache": true,
"mergingCache": true,
"categorizationCache": true,
"outputCompression": true,
"checkConfidence": true,
"maxRows": 10,
"truncate": true,
"dropTime": true,
"minConf": 1,
"minSupport": 0.8,
"slidingWindow": 20,
"slidingWindowInterval": 1,
"miningLimit": 0,
"miningPredictionWindow": 60,
"miningTimeout": "1800s",
"workers": 2,
"evalWorkers": 2,
"compression": true,
"yearlyPartition": false,
"clusteringEpsilon": 0.0001,
"clusteringNumber": 40,
"clusteringBorderPoints": true,
"numberOfRetries": 5,
"classifierSelection": {
"map": {
"Bluetooth Sensor Data": false,
"Common Time": true,
"GPS Sensor Data": true,
"Audio Inference": false,
"Activity Inference": false,
"Charging Status": true,
"Wifi Sensor Data": true,
"Conversation Inference Status": true,
"Smartphone Lock Status": true,
"Dark Environment": true
}
}
},
"results": [
{
"testSet": {
"number": 1
},
"results": {
"map": {
"MINING": {
"index": 1,
"prefix": "MINING",
"result": {},
"interval": 79,
"configHash": 1629491621
},
"CATEGORIZATION": {
"index": 1,
"prefix": "CATEGORIZATION",
"result": {},
"interval": 0,
"configHash": 1005792641
},
"CLASSIFICATION": {
"index": 1,
"prefix": "CLASSIFICATION",
"result": {},
"interval": 16,
"configHash": 1005792641
},
"MERGING": {
"index": 1,
"prefix": "MERGING",
"result": {},
"interval": 11,
"configHash": 805257525
},
"VALIDATION": {
"index": 1,
"prefix": "VALIDATION",
"result": {
"applicableNumber": 1350,
"invalidNumber": 622,
"correctRuleNumber": 30,
"incorrectRuleNumber": 20,
"allRuleNumber": 50
},
"interval": 0,
"configHash": 1629491621
},
"READING": {
"index": 1,
"prefix": "READING",
"result": {},
"interval": 0,
"configHash": 1910599551
}
}
}
},
{
"testSet": {
"number": 0
},
"results": {
"map": {
"MINING": {
"index": 0,
"prefix": "MINING",
"result": {},
"interval": 341,
"configHash": 1629491621
},
"CATEGORIZATION": {
"index": 0,
"prefix": "CATEGORIZATION",
"result": {},
"interval": 0,
"configHash": 1005792641
},
"CLASSIFICATION": {
"index": 0,
"prefix": "CLASSIFICATION",
"result": {},
"interval": 9,
"configHash": 1005792641
},
"MERGING": {
"index": 0,
"prefix": "MERGING",
"result": {},
"interval": 10,
"configHash": 805257525
},
"VALIDATION": {
"index": 0,
"prefix": "VALIDATION",
"result": {
"applicableNumber": 193,
"invalidNumber": 0,
"correctRuleNumber": 25,
"incorrectRuleNumber": 0,
"allRuleNumber": 25
},
"interval": 0,
"configHash": 1629491621
},
"READING": {
"index": 0,
"prefix": "READING",
"result": {},
"interval": 1,
"configHash": 1910599551
}
}
}
}
]
},
{
"config": {
"caching": true,
"removeSensorData": true,
"outputEnablePartitioning": false,
"outputPartitions": 1,
"start": 0,
"end": 1,
"classificationCache": true,
"mergingCache": true,
"categorizationCache": true,
"outputCompression": true,
"checkConfidence": true,
"maxRows": 10,
"truncate": true,
"dropTime": true,
"minConf": 1,
"minSupport": 0.7,
"slidingWindow": 20,
"slidingWindowInterval": 1,
"miningLimit": 0,
"miningPredictionWindow": 60,
"miningTimeout": "1800s",
"workers": 2,
"evalWorkers": 2,
"compression": true,
"yearlyPartition": false,
"clusteringEpsilon": 0.0001,
"clusteringNumber": 40,
"clusteringBorderPoints": true,
"numberOfRetries": 5,
"classifierSelection": {
"map": {
"Bluetooth Sensor Data": false,
"Common Time": true,
"GPS Sensor Data": true,
"Audio Inference": false,
"Activity Inference": false,
"Charging Status": true,
"Wifi Sensor Data": true,
"Conversation Inference Status": true,
"Smartphone Lock Status": true,
"Dark Environment": true
}
}
},
"results": [
{
"testSet": {
"number": 1
},
"results": {
"map": {
"MINING": {
"index": 1,
"prefix": "MINING",
"result": {},
"interval": 198,
"configHash": -994027222
},
"CATEGORIZATION": {
"index": 1,
"prefix": "CATEGORIZATION",
"result": {},
"interval": 0,
"configHash": 1005792641
},
"CLASSIFICATION": {
"index": 1,
"prefix": "CLASSIFICATION",
"result": {},
"interval": 18,
"configHash": 1005792641
},
"MERGING": {
"index": 1,
"prefix": "MERGING",
"result": {},
"interval": 12,
"configHash": 805257525
},
"VALIDATION": {
"index": 1,
"prefix": "VALIDATION",
"result": {
"applicableNumber": 1357,
"invalidNumber": 622,
"correctRuleNumber": 44,
"incorrectRuleNumber": 20,
"allRuleNumber": 64
},
"interval": 0,
"configHash": -994027222
},
"READING": {
"index": 1,
"prefix": "READING",
"result": {},
"interval": 0,
"configHash": 1910599551
}
}
}
},
{
"testSet": {
"number": 0
},
"results": {
"map": {
"MINING": {
"index": 0,
"prefix": "MINING",
"result": {},
"interval": 980,
"configHash": -994027222
},
"CATEGORIZATION": {
"index": 0,
"prefix": "CATEGORIZATION",
"result": {},
"interval": 0,
"configHash": 1005792641
},
"CLASSIFICATION": {
"index": 0,
"prefix": "CLASSIFICATION",
"result": {},
"interval": 10,
"configHash": 1005792641
},
"MERGING": {
"index": 0,
"prefix": "MERGING",
"result": {},
"interval": 9,
"configHash": 805257525
},
"VALIDATION": {
"index": 0,
"prefix": "VALIDATION",
"result": {
"applicableNumber": 553,
"invalidNumber": 0,
"correctRuleNumber": 86,
"incorrectRuleNumber": 0,
"allRuleNumber": 86
},
"interval": 0,
"configHash": -994027222
},
"READING": {
"index": 0,
"prefix": "READING",
"result": {},
"interval": 1,
"configHash": 1910599551
}
}
}
}
]
}
]
}
To shut the machine down, we stop the container.
docker stop asra
We can start it again later.
docker start asra
Alternatively, we can start over by removing the container.
docker rm asra
Content type
Image
Digest
Size
1.5 GB
Last updated
over 9 years ago
docker pull matfax/asra