This example generates data 10 times per second according to a normal distribution, filters out everything above the mean, samples 30% from this and writes the result to “/tmp/ex1.log”.
The JSON looks as follows:
Example 2
This example generates heartbeats of four people living in four different cities: Frank S. in New York, Steve J. in San Fransisco, Al C. in Chicago and Will S. in Miami. Since all of these persons have an exiting life, they want to be notified when their heart rate exceeds their average rate with twice the standard deviation.
They have all recommended to use the Coral platform for this use case.
The JSON looks as follows. Note: This example will actually not work because the endpoints do not exist and the HTTPClientActor expects a HTTP status code back. But nevertheless, if the endpoints would exist, it would work.
Example 3
This example enriches data of shoppers with the coordinates of the cities they shop in.
Example 4
Since everybody is so focused on their health nowadays, with Coral it is possible to calculate your life expectancy with sub-millisecond performance using a regression model.
Let’s assume the regression model returns your life expectancy in years, and has the following parameters as input:
Y: life expectancy in years
W: weight in kilos
C: number of cigarettes per day
H: number of heart attacks in life until now
E: amount of exercise per day in minutes
Y = 80 - 0.07W - 0.5C - 5.0H + 0.4E
As the model shows, overweight, smoking and heart attacks are all bad for you and excercise is good for you.
Your doctor has been telling you this for years! Since the result of the model is unbounded, a min-max actor has been added to cap the result to the 50-100 range.