degrees (of freedom) in uncertain reasoning
Post on 18-Oct-2014
323 views
DESCRIPTION
RuleML Technical WebinarTRANSCRIPT
ENEAENEA
RuleML Telecon – Nov.27th, 2009
Degrees (of freedom)Degrees (of freedom)in Uncertain Reasoningin Uncertain Reasoning
Davide SottaraDEIS, Faculty of Engineering, University of Bologna
40100 Bologna (BO), Italy
11/27/0911/27/09 22
Imperfect InformationDifferent types of “afflictions”:Different types of “afflictions”:
ReliabilityReliability (Confidence)(Confidence)• E.g.: Temperature = 25° E.g.: Temperature = 25° (( = = 70/100)70/100)
Measures the “strength” of the estimate (Conflicting) alternatives may be considered
Uncertainty, properUncertainty, proper (Probability, “prior”)(Probability, “prior”)Both subjective (bayesian) and objective (frequentist)Both subjective (bayesian) and objective (frequentist)
• E.g.: TemperatureE.g.: Temperature = 25° = 25° (( = = 70%) 70%) Temperature is expected to be (precisely) 25° May be completely different
VaguenessVagueness (Fuzzy, “posterior”)(Fuzzy, “posterior”)• E.g.: TemperatureE.g.: Temperature ≈ 25° ≈ 25° (( = 0.7) = 0.7)
The value, e.g. 22°, is known to be “similar” to 25°. Data known precisely, but expressed vaguely.
11/27/0911/27/09 33
Simple Examples
rulerule "Bet - Fuzzy""Bet - Fuzzy"
whenwhen
$b: Bet( $a : amount $b: Bet( $a : amount isis highhigh, $n : number ), $n : number )
Extraction( outcome == $n ) Extraction( outcome == $n )
thenthen
insertinsert((newnew Win($a Win($a),”),”very highvery high”); ”);
endend
11/27/0911/27/09 44
Simple Examples
rulerule "Bet - Fuzzy""Bet - Fuzzy"
whenwhen
$b: Bet( $a : amount $b: Bet( $a : amount isis highhigh, $n : number ), $n : number )
Extraction( outcome == $n ) Extraction( outcome == $n )
thenthen
insertinsert((newnew Win($a Win($a),”),”very highvery high”); ”);
endend
rulerule "Bet - Probabilistic""Bet - Probabilistic"
whenwhen
$b: Bet( $a : amount, $n : number )$b: Bet( $a : amount, $n : number )
Extraction( outcome Extraction( outcome ==== $n ) $n )
thenthen
gain = $a / gain = $a /
endend
11/27/0911/27/09 55
Simple Examples
rulerule "Bet - Fuzzy""Bet - Fuzzy"
whenwhen
$b: Bet( $a : amount $b: Bet( $a : amount isis highhigh, $n : number ), $n : number )
Extraction( outcome == $n ) Extraction( outcome == $n )
thenthen
insertinsert((newnew Win($a Win($a),”),”very highvery high”); ”);
endend
rulerule "Bet - Probabilistic""Bet - Probabilistic"
whenwhen
$b: Bet( $a : amount, $n : number )$b: Bet( $a : amount, $n : number )
Extraction( outcome Extraction( outcome ==== $n ) $n )
thenthen
gain = $a / gain = $a /
endend
rulerule "Bet - Mixed""Bet - Mixed"
whenwhen
$b: Bet( $a : amount $b: Bet( $a : amount isis highhigh, $n : number ), $n : number )
negneg Extraction( outcome Extraction( outcome ==== $n ) $n )
thenthen
ExpectedRisk r = ...ExpectedRisk r = ...
endend
11/27/0911/27/09 66
vs
BenefitsBenefits
RobustnessRobustness Handle Inaccurate inputsHandle Inaccurate inputs Avoid arbitrary thresholdsAvoid arbitrary thresholds
ConvenienceConvenience Knowledge is rarelyKnowledge is rarely preciseprecise
ConcisenessConciseness Compact expressions Compact expressions
DrawbacksDrawbacks
ComplexityComplexity In writing rulesIn writing rules In evaluating rulesIn evaluating rules
CoherenceCoherence MaintainMaintain soundness soundness
11/27/0911/27/09 77
Expressing Imperfection
Damasio, Pan, Stoilos & Straccia (2008)Damasio, Pan, Stoilos & Straccia (2008)
Different Different non-booleannon-boolean rules can be encoded rules can be encoded Generalize the idea of (truth) Generalize the idea of (truth) degreedegree Generalize the idea of logic Generalize the idea of logic operatoroperator
Their work has led to Their work has led to fuzzyRuleMLfuzzyRuleML
What about Evaluation?What about Evaluation?
11/27/0911/27/09 88
(Truth) Degrees Different Different modelsmodels generalize {T,F} generalize {T,F}
High order models may combine different typesHigh order models may combine different types
0“false”
1“true”
0“false”
1“true”
0“false”
1“true”
0“false”
1“true”
Real Value [0,1]
Interval [0,1]2
Distribution [0,1] → [0,1] Type II fuzzy set
Imprecise Distribution [0,1] → [0,1]3
Type III fuzzy set
11/27/0911/27/09 99
Evaluators Predicates are no longer “just” true (or false)Predicates are no longer “just” true (or false)
Information may come from Information may come from differentdifferent sources: sources:
FactsFacts : “a priori” information : “a priori” information Embedded EvaluatorEmbedded Evaluator
• Possibly externalPossibly external RulesRules : chaining : chaining
⇒
Age > 18
⇒
Degrees have to be Degrees have to be mergedmerged ( (∩∩ )) May be May be missingmissing** ( (⊘⊘)) May be May be discounteddiscounted** ( () by confidence) by confidence May May overrideoverride** others ( others ())
11/27/0911/27/09 1010
Operators
α
α
isA
Bet
high
amount
isA
Extract
$n
number
= 3
value
⊗ ∧
⊗
LiteralLiteral and and LogicalLogical Evaluators (Operators) are Evaluators (Operators) are configurableconfigurable Implementation Implementation kindkind** chosen individually chosen individually
• With With defaultdefault**• Refined using Refined using argumentsarguments**
Bet( $a : amount Bet( $a : amount isis highhigh, $n : number , $n : number Extraction( value Extraction( value ==== 3 ) 3 )
11/27/0911/27/09 1111
Full Entailment
GeneralizedGeneralizedPropagationPropagation** policy policy ““Propagate Propagate iffiff true” not suitable true” not suitable
ImplicationImplication is evaluated is evaluated
Modus PonensModus Ponens is evaluated is evaluated Using Premise and ImplicationUsing Premise and Implication
α
α
⊗
β
β
⇒
→
11/27/0911/27/09 1212
Engine extensionCore component : Core component : FactoryFactory
Builds Builds DegreesDegrees Builds (coherent) Builds (coherent) OperatorsOperators
Provides Provides PropagationPropagation Policy Policy• PASSPASS, , HOLDHOLD, , DROPDROP
Provides Provides MergeMerge Strategy Strategy• Handles missing valuesHandles missing values• Discounts and OverridesDiscounts and Overrides
AttributesAttributes are passed to the factory are passed to the factory
11/27/0911/27/09 1313
f-RuleML Attributes / 1@@degreedegree
AppliesApplies--toto : : Evaluators, Operators, RulesEvaluators, Operators, Rules ValueValue : : any any RoleRole : : prior, constant value (may be merged withprior, constant value (may be merged with
other contributions)other contributions) FactoryFactory:: parses the value to return a Degreeparses the value to return a Degree
@@kindkind AppliesApplies--toto : : Operators, (Evaluators), RulesOperators, (Evaluators), Rules ValueValue : : depends on logic familydepends on logic family Role Role : : select the type of operatorselect the type of operator FactoryFactory:: chooses the actual implementation chooses the actual implementation
11/27/0911/27/09 1414
f-RuleML Attributes / 2@@argsargs
AppliesApplies--toto : : Evaluators, (Operators), (Rules)Evaluators, (Operators), (Rules) ValueValue : : String String Role Role : : additional initialization parameters for the additional initialization parameters for the
evaluator / operatorevaluator / operator FactoryFactory:: passes the String to the constructorpasses the String to the constructor
@@defaultdefault AppliesApplies--toto : : Operators, Evaluators, RulesOperators, Evaluators, Rules ValueValue : : n.a.n.a. Role Role : : forces the default optionsforces the default options FactoryFactory:: ignores other initialization parametersignores other initialization parameters
11/27/0911/27/09 1515
Examples / 1
rulerule "Attr1""Attr1"
whenwhen
Toss ( side == Toss ( side == @[ degree=0.5 ]@[ degree=0.5 ] “heads”) “heads”)
thenthen
// ...// ...
endend rulerule "Attr2""Attr2"
whenwhen
Coin( weight Coin( weight << @[args=”tol=0.2,unit=g”]@[args=”tol=0.2,unit=g”]
10 ])
oror @[ kind=”Max” ]@[ kind=”Max” ]
Dice( faces == 4)Dice( faces == 4)
thenthen ... ... endend
11/27/0911/27/09 1616
f-RuleML Attributes / 3
@@idid AppliesApplies--toto : : Evaluators, OperatorsEvaluators, Operators ValueValue : : IDID Role Role : : unique identifier. unique identifier.
May be used to chain rules May be used to chain rules (i.e. a rule entails the truth of a constraint)(i.e. a rule entails the truth of a constraint)
FactoryFactory:: n.a.n.a.
@@filterfilter AppliesApplies--toto : : Operators, Evaluators, RulesOperators, Evaluators, Rules ValueValue : : ** Role Role : : selects the rule-propagation strategyselects the rule-propagation strategy FactoryFactory:: chooses the actual implementationchooses the actual implementation
11/27/0911/27/09 1717
f-RuleML Attributes / 4@@booleanboolean
AppliesApplies--toto : : Evaluators, Operators, RulesEvaluators, Operators, Rules ValueValue : : “true” | “false” (optional)“true” | “false” (optional) Role Role : : the result is approximated with a booleanthe result is approximated with a boolean FactoryFactory:: casts the actual Degree to a Degreecasts the actual Degree to a Degree
modelling T (resp. F)modelling T (resp. F)
@@crispcrisp AppliesApplies--toto : : Operators, Evaluators, RulesOperators, Evaluators, Rules ValueValue : : “true” | “false” (optional)“true” | “false” (optional) Role Role : : forces the canonical evaluationforces the canonical evaluation FactoryFactory:: the result is cast to boolean andthe result is cast to boolean and
propagation is halted on falsepropagation is halted on false
11/27/0911/27/09 1818
Examples / 2rulerule "Attr3""Attr3"
whenwhen
$c : Coin( )$c : Coin( )
Toss ( coin ==Toss ( coin == @[ crisp] @[ crisp] $c ) $c )
thenthen
insertinsert($c,”id_lucky”)($c,”id_lucky”)
endend
rulerule "Attr4""Attr4"
whenwhen
$c : Coin( this $c : Coin( this is @[ id=”id_lucky”] “lucky”)
thenthen
......
endend
11/27/0911/27/09 1919
f-RuleML Attributes / 5@@mergemerge
AppliesApplies--toto : : Evaluators, Operators, RulesEvaluators, Operators, Rules ValueValue : : ** Role Role : : Degree fusion strategyDegree fusion strategy FactoryFactory:: chooses the actual implementationchooses the actual implementation
@@missingmissing AppliesApplies--toto : : Evaluators, Operators, RulesEvaluators, Operators, Rules ValueValue : : ** Role Role : : Missing value completion strategyMissing value completion strategy FactoryFactory:: chooses the actual implementationchooses the actual implementation
11/27/0911/27/09 2020
f-RuleML Attributes / 5@@overrideoverride
AppliesApplies--toto : : Evaluators, Operators, RulesEvaluators, Operators, Rules ValueValue : : ** Role Role : : ““Defeat” degree strategyDefeat” degree strategy FactoryFactory:: chooses the actual implementationchooses the actual implementation
@@discountdiscount AppliesApplies--toto : : Evaluators, Operators, RulesEvaluators, Operators, Rules ValueValue : : ** Role Role : : Confidence-based strategyConfidence-based strategy FactoryFactory:: chooses the actual implementationchooses the actual implementation
11/27/0911/27/09 2121
Examples / 3
rulerule "Attr5""Attr5"
whenwhen
Toss( side == “heads”,Toss( side == “heads”,this is @[ degree=”[0.4,0.6]”,
merge=”Intersect”, missing=”OWA” ]
“probable” )
thenthen
......
endend
11/27/0911/27/09 2222
Work–in–progressExtending RETE: Extending RETE:
@id
@filter
Evaluator(@kind,@args)
Degree[ ]
∩,,⊘
11/27/0911/27/09 2323
Conclusionsf-RuleMLf-RuleML supports Imperfect Rules: supports Imperfect Rules:
Rules Rules definedefine the the abstractabstract constraints constraints Attributes Attributes specifyspecify the the concreteconcrete semantics semantics
Evaluation requires more customizationsEvaluation requires more customizations Additional Additional attributesattributes can be used can be used
Different logics can be used by setting the Different logics can be used by setting the defaultdefault values appropriately values appropriately Individual rules can override themIndividual rules can override them