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
Next revision Both sides next revision
pub:software:heartdroid:tutorials:uncertainty_cf [2017/01/03 12:37]
admin
pub:software:heartdroid:tutorials:uncertainty_cf [2017/01/04 12:35]
admin [Use case]
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]]:​
  
 <​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 the attributes'​ values, to rules conditions, and to the rules directly.  
- +You can see, that for instance table ''​transportationModeA''​ has rules which CF are lower than 1. 
-You can see, that for instance table ''​transportationModeA''​ has rules which CF'​s ​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. 
-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.+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 46: Line 45:
 </​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 58: Line 57:
 </​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.txt · Last modified: 2019/04/10 06:54 (external edit)