HeaRTDroid

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

User Tools

Site Tools


pub:software:heartdroid:tutorials:uncertainty_cf

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:uncertainty_cf [2017/01/03 13:37]
admin [Use case]
pub:software:heartdroid:tutorials:uncertainty_cf [2019/04/10 08:54] (current)
Line 21: Line 21:
 If you are not familiar with the CF algebra, see [[.:​uncertainty_cf#​certainty_factors_algebra_axioms| Certainty Factors Axioms]] section. If you are not familiar with the CF algebra, see [[.:​uncertainty_cf#​certainty_factors_algebra_axioms| Certainty Factors Axioms]] section.
  
-The model that (partially) solves the problem ​presented ​above is presented in the following figure.+The model that (partially) solves the problem ​given above is presented in the following figure.
 The complete model with test scripts and basic callbacks can be downloaded from {{:​pub:​software:​heartdroid:​tutorials:​parking-zones-cf.zip|here}}. The complete model with test scripts and basic callbacks can be downloaded from {{:​pub:​software:​heartdroid:​tutorials:​parking-zones-cf.zip|here}}.
 +
 +{{:​pub:​software:​heartdroid:​tutorials:​parking-zones-cf.png|}}
  
 To run the example, you will need the latest version of [[pub:​software:​heartdroid:​tutorials:​haquna|HaQuNa]]:​ To run the example, you will need the latest version of [[pub:​software:​heartdroid:​tutorials:​haquna|HaQuNa]]:​
Line 28: Line 30:
 <​code>​ <​code>​
 javac -cp haquna.jar:​. *.java javac -cp haquna.jar:​. *.java
-</​code>​ 
- 
-Then, you can run a script that loads the model, sets the initial state and run the inference: 
- 
-<​code>​ 
 java -cp haquna.jar:​. haquna.HaqunaMain --console test-script-cf.hqn java -cp haquna.jar:​. haquna.HaqunaMain --console test-script-cf.hqn
 </​code>​ </​code>​
  
-{{:pub:software:heartdroid:​tutorials:​parking-zones-cf.png|}} +The certainty factors (CF) in XTT2 models can be assigned to three different elements: 
- +  - to the attributes'​ values -- this is usually done when the value is obtained from context-provier (sensor, user, etc.). This represents the confidence the value is correct. 
-You can see, that for instance table ''​transportationModeA''​ has rules which CF'​s ​are lower than 1. +  - to rules conditions -- this is evaluated based on the CF of the attribute'​s value from the condition. The complete set of rules for how to evaluate the CF of conditional formula is given in//Bobek S., Nalepa G. (2016). [[http://​dx.doi.org/​10.1016/​j.pmcj.2016.09.004|Uncertainty handling in rule-based mobile context-aware systems]], Pervasive and Mobile Computing//​ 
-It means that the rules themselves are not completely certain ​ and the resulting confidence of the conclusion is calculated as a product of a minimal CF from the conditions ​list and the confidence of the rule.+  - to the rules directly -- this assignment is done by the knowledge engineer or machine learning methods. It represents the confidence of the rule itself being correct
 +  
 +You can see, that for instance table ''​transportationModeA''​ has rules which CF are lower than 1. 
 +It means that the rules themselves are not completely certain ​ and the resulting confidence of the conclusion ​they produce is not certain as well. 
 +Its certainty ​is calculated as a product of a minimal CF of the conditions and the confidence of the rule.
 For example if the value of ''​recent_activity''​ was ''​in_vehicle'',​ but the confidence of this activity was 0.3, and the number of nearby devices was 3 with confidence 1.0, than the overall confidence of the conclusion of the first rule would be ''​min(0.3,​1.0)*0.6=0.18''​. For example if the value of ''​recent_activity''​ was ''​in_vehicle'',​ but the confidence of this activity was 0.3, and the number of nearby devices was 3 with confidence 1.0, than the overall confidence of the conclusion of the first rule would be ''​min(0.3,​1.0)*0.6=0.18''​.
-The same confidence would be calculated for the last rule, and hence these two rules will be fired, ​and two ambiguous ​conclusions ​will be added to working ​memory:+The same confidence would be calculated for the last rule, and both rules will be fired
 +As a result, two ambiguous ​values of the attribute ​will be stored in the memory:
 <​code>​ <​code>​
 transportation_mode = car#0.18 transportation_mode = car#0.18
Line 47: Line 49:
 </​code>​ </​code>​
  
-On the other hand, there is another table that produces values for ''​transportation_mode''​ attribute -- the ''​transportationModeB''​ table.+However, there is another table that produces values for ''​transportation_mode''​ attribute -- the ''​transportationModeB''​ table.
 This table sets the value of the ''​transportation_mode''​ attribute based on the analysis of mobile phone [[http://​www.awareframework.com/​screen/​|screen activity]]. If the user plays with the phone, it could mean that he or the is not driving a car. This table sets the value of the ''​transportation_mode''​ attribute based on the analysis of mobile phone [[http://​www.awareframework.com/​screen/​|screen activity]]. If the user plays with the phone, it could mean that he or the is not driving a car.
-Let us assume that the last rule from his table is true, so the activity of the screen is not high, hence the last rule from the table will be fired.+Let us assume that only the last rule from this table is true.
 According to disjunctive formula, the confidence of the ''​transportation_mode set car''​ will be ''​min(0.3,​1.0)*0.9=0.27''​ According to disjunctive formula, the confidence of the ''​transportation_mode set car''​ will be ''​min(0.3,​1.0)*0.9=0.27''​
  
Line 59: Line 61:
 </​code>​ </​code>​
  
-This is the last table that produces the value for ''​transportation_mode''​ (actually there is another one, but is is empty), hence the disambiguation process for these three values can begin. +''​transportationModeB''​ was the last table that produces the value for ''​transportation_mode''​ (actually there is another one, but is is empty), hence the disambiguation process for these three values can begin. 
-This values are treated as cumulative values (i.e. they strengthen or weaken their confidence) and are evaluated according to cumulative formula from CF algebra presented in the last equation ​from the [[pub:​software:​heartdroid:​tutorials:​uncertainty_cf##​certainty_factors_algebra_axioms|CF axioms]] section:+This values are treated as cumulative values (i.e. they strengthen or weaken their confidence) and are evaluated according to cumulative formula from CF algebra presented in the last equation ​in the [[pub:​software:​heartdroid:​tutorials:​uncertainty_cf##​certainty_factors_algebra_axioms|CF axioms]] section:
 ''​0.18+0.27-0.18*0.27=0.4014''​. ''​0.18+0.27-0.18*0.27=0.4014''​.
  
-And this is what you should see after running the example script given at the beginning of the section.+After running the example script given at the beginning of the section ​you should see the output presented below.
 Note, that the certainty factors of transportation mode is exactly the same as we calculated. Note, that the certainty factors of transportation mode is exactly the same as we calculated.
  
pub/software/heartdroid/tutorials/uncertainty_cf.1483447077.txt.gz · Last modified: 2019/04/10 08:54 (external edit)