Masinprojekteerimine * A.Kalja * Arvutitehnika instituut 4.3 Xpert - an inductive expert system...

Post on 17-Dec-2015

217 views 2 download

Transcript of Masinprojekteerimine * A.Kalja * Arvutitehnika instituut 4.3 Xpert - an inductive expert system...

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

4.3 Xpert - an inductive expert system shell(full course)

1. Introduction1.1 Inductive knowledge syntheses1.2 General description of Xpert subsystem1.3 Xpert menu and corresponding actions2. Working with system in expert mode2.1 Specification of the attributes 2.2 Adding examples2.3 Changes in expert knowledge base2.4 Decision tree3. Derivation mechanism3.1 Expertsystem and computat. model connections3.2 The types of of attributes and actions 3.3 Joining expert knowledge bases4. Expertsystem and computat. model cooperation4.1 Modes of cooperations4.2 The concept expert5. Additional information5.1 The structure of expert knowledge file5.2 Restrictions5.3 Error messages

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Knowledgebase

Inferenceengine User

Architecture of expert system

Structuredinformation

Unstructuredinformation

Conventional calculations

Expert-systems

Human thinkingprocess

Expertsystem as a bridge

Expert systems

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Deductive ja inductivelearning

Deductive learning: Rules are given, which are correct in general case. Derivation of the situation or behavior, what is right for the individual case.

If … Then …If … Then …Kui … Siis ...Kui … Siis ...

If the shop is located in the old downIf the shop is located in the old down Then you have problems with transportThen you have problems with transport

Inductive learning: A set of examples are givenabout typical situations or decisions. The general rule is found using these examples.

Rules depends *from the algorithm of of the inference engine

*from the amount of examples

If the algorithm is “effective” and the number ofexamples is “informative”, then the result isa “good” rule.

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Expert System Shell Xpert

To build an expert system means to create an expertknowledge base i.e. to specify a number of examplesabout how the expert system will behave in solving problems of the given domain. If a problem can bedescribed by means of the attributes A,B,C,…,RESULT, then the examples have the following meaning:

IF A=a1 AND B=b1 AND C=c1 AND … THEN RESULT=r1IF A=a2 AND B=b2 AND C=c2 AND … THEN TULEMUS=r2etc.

Example:If the road is dry and the visibility is more than 100 m,the advisable speed is not more than 90 km/h;If the road is dry and the visibility is less than 100 m,then-not more than 80 km/h;If the road is wet and the visibility is more than 100 m,then-not more than 90 km/h;If the road is wet and the visibility is less than 100 m,then-not more than 70 km/h;If the road is sleety, then-not more than 50 km/h.

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Basic concepts

Attribute - a factor or feature of the problem under consideration. It has a name, values and it can also have a related text. An attribute can also express a solution of a problem, e.g. "Accept the candidate for the job". In this case the attribute is called a result attribute.

Example – a condition with a certain conclusion. The conclusion can be a decision, a diagnosis, a piece of advice, etc. Each example describesa particular situation. If in a certain situation there are some factors with no influence to the conclusion, then the appropriate example has special don't care values (“-") corresponding to these attributes.

Expert knowledge base – For describing a problem, usually a set of examples is needed. This set of examples is called expert knowledge base.

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Cooperation between Expertsystem and Solver

road visibility ? < RESULT

1 dry over 100 m speed=[km/h] speed<=90 correct speed2 dry over 100 m speed=[km/h] speed>90 wrong speed3 dry less than 100m speed=[km/h] speed<=80 correct speed4 dry less than 100m speed=[km/h] speed>80 wrong speed

...

There exists 4 types of attributes:- choice attribute- RESULT attribute- message attribute- comparison attribute

Chaining expert knowledge bases.

RESULT attribute can have a value#<name_of_expert_KB>#road2.exp

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Optimization of expert knowledge

Example:

HEIGTH HAIREYESResult1 short blond blue +2 tall blond brown -3 tall red blue +4 short dark blue -5 tall dark blue -6 tall blond blue +7 tall dark brown -8 short blond brown -

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

HEIGTH

HAIR HAIR

short tall

EYES

blond dark blond red dark

EYES- + -

blue brown brown blue

+ +- -

HAIR

blond red dark

EYES +

+

blue brown

-

-

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Algoritm ID3 (Iterative Dichotomizer 3)Ross Quinlan 1979

Let we have a set of examples and a set of attributes.

The informative value of the set of the examples (about result attribute) is:

Io=-Σ pilog2pi , where pi is proportion of theresult of I class.

We can find the informative value of the attributeI1= Σ qnin , where qn is proportion of the

examples with value n.

Algorithm selects an attribute whose valueis the maximum of the following subtraction:

Io-I1

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Example: knowledge base with 8 examples

I0=-3/8log23/8-5/8log25/8=0.954I(heigth=tall)= -2/5log22/5-3/5log23/5=0.971I(heigth=short)= -1/3log21/3-2/3log22/3=0.918

Iheigth=5/8*0.971+3/8*0.918=0.951

I0-Iheigth =0.954-0.951= 0.003

Ihair=3/8*0+1/8*0+4/8*1=0.5

I0-Ihair =0.954-0.5= 0.454

I0-Ieyes=0.954-0.607= 0.347

hair

blond red dark

eyes + -

blue brown

Max! – derivationalstem is hair

+ -

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Fail XTREE.$$$

Expert knowledge base name:

HAIR:

blond -> EYES:

blue -> RESULT:+

brown -> RESULT:-

red -> RESULT:+

dark -> RESULT:-

End of tree

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

HEIGT HAIR EYESResult1 short blond blue +2 tall blond brown -3 tall red blue +4 - dark blue -5 tall blond blue +6 tall dark brown -7 short blond brown -

HEIGTH HAIR EYESHEALTH Result1 - - - sick -2 short blond blue okey +3 tall blond brown okey -4 tall red blue - +5 - dark blue okey -6 tall blond blue okey +7 tall dark brown okey -8 short blond brown okey -

Clashing examples:1 4

Save with clashes? (Y/N)

Optimization of expert knowledge

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

Xpert and Solver interface

Solver Xpert

I

calculations ?results

IIcalculations

results

Concept expert:ex_base textresult undefinedex_base -> result {modexp}

Masinprojekteerimine * A.Kalja * Arvutitehnika instituut

ROAD.EXP

ROAD RESULTglazed frost 0.1trampled snow 0.2slushy snow 0.3frozen snow 0.4splash 0.3wet and dusty 0.4wet asphalt 0.5dry gravel 0.6dry asphalt 0.7

!mi speed!mi react_timeacceleration=-9.81*fr_factorROAD expert ex_base=‘ROAD’ result=fr_factorR move [km/h]=speed t=react_timeA movea v1=0 v0=R.v a=accelerationBr_distance=R.s+A.s?Br_distance