HeaRTDroid

HeaRTDroid is a rule-based inference engine both for Android mobile devices, and desktop solutions

User Tools

Site Tools


pub:software:heartdroid:tutorials:tbo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
pub:software:heartdroid:tutorials:tbo [2017/01/03 06:00]
admin [Use case]
pub:software:heartdroid:tutorials:tbo [2019/04/10 06:54] (current)
Line 49: Line 49:
 Then, you can run a script that loads the model, sets the initial state and run the inference: Then, you can run a script that loads the model, sets the initial state and run the inference:
 <​code>​ <​code>​
-java -cp haquna.jar:​. haquna.HaqunaMain --console test-script.hmr+java -cp haquna.jar:​. haquna.HaqunaMain --console test-script.hqn
 </​code>​ </​code>​
  
Line 58: Line 58:
 wm.setValueOf('​recent_activity','​on_foot'​) wm.setValueOf('​recent_activity','​on_foot'​)
 </​code>​ </​code>​
-Wait for a minute (literally, as this is what was set in the formula) and run the inference again:+Wait for a minute (literally, as this is what was set in the formula) and run the inference again twice (to force that the ''​on_foot''​ will appear more than 80% during lsst minute):
 <​code>​ <​code>​
 model.run(wm,​inference=gdi,​tables=['​parkingReminder'​]) model.run(wm,​inference=gdi,​tables=['​parkingReminder'​])
Line 67: Line 67:
 The sample output may look as follows: The sample output may look as follows:
 <​code>​ <​code>​
-Attribute: notification ​ = free_to_park ​ cf = 0.8097445 +Attribute: notification ​ = free_to_park ​ cf = 0.80999994 
-Attribute: daytype ​ = workday ​  cf = 1.0 +Attribute: daytype ​ = weekend ​  cf = 1.0 
-Attribute: hour  = 6.0  cf = 1.0+Attribute: hour  = 13.0  cf = 1.0
 Attribute: recent_activity ​ = on_foot ​ cf = 1.0 Attribute: recent_activity ​ = on_foot ​ cf = 1.0
-Attribute: vehicle_action ​ = start_parking ​ cf = 0.8097445+Attribute: vehicle_action ​ = start_parking ​ cf = 0.80999994
 Attribute: payment ​ = null  cf = 1.0 Attribute: payment ​ = null  cf = 1.0
 Attribute: location ​ = pay_zone ​ cf = 1.0 Attribute: location ​ = pay_zone ​ cf = 1.0
 Attribute: tariff ​ = free  cf = 1.0 Attribute: tariff ​ = free  cf = 1.0
-Attribute: past_activity ​ = in_vehicle ​ cf = 0.89971614 +Attribute: past_activity ​ = in_vehicle ​ cf = 0.9 
-Attribute: day  = tue/  cf = 1.0+Attribute: day  = sun/  cf = 1.0
 </​code>​ </​code>​
 +
 +The numbers next to each of the attributes values marked as ''​cf''​ are certainty factors assigned to each values representing the confidence in the value. Some CF's are less than one, as we explicitly set that the confidence of the rules producing these values are lower (see last column of each table, with ''#''​ in the header). For more on how to use certainty factors to handle uncertainty see [[pub:​software:​heartdroid:​tutorials:​uncertainty_cf|Managing uncertainty with Certainty Factors Algebra]] tutorial.
  
 ===== Syntax of time-based operators ===== ===== Syntax of time-based operators =====
pub/software/heartdroid/tutorials/tbo.1483423206.txt.gz · Last modified: 2019/04/10 06:54 (external edit)